Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81017845 authored by Liam Mark's avatar Liam Mark
Browse files

mm/memory_hotplug: Rate limit page migration warnings



When offlining memory the system can attempt to migrate a lot of pages,
if there are problems with migration this can flood the logs.

Rate limit the page migration warnings in order to avoid this.

Change-Id: Iaf140cfc2f48cd441a384864c4d0b409db7b89d7
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
parent e1bdeb41
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -1348,6 +1348,8 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
	struct page *page;
	int ret = 0;
	LIST_HEAD(source);
	static DEFINE_RATELIMIT_STATE(migrate_rs, DEFAULT_RATELIMIT_INTERVAL,
				      DEFAULT_RATELIMIT_BURST);

	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
		if (!pfn_valid(pfn))
@@ -1395,9 +1397,11 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
						    page_is_file_cache(page));

		} else {
			if (__ratelimit(&migrate_rs)) {
				pr_warn("failed to isolate pfn %lx\n", pfn);
				dump_page(page, "isolation failed");
			}
		}
		put_page(page);
	}
	if (!list_empty(&source)) {
@@ -1406,10 +1410,12 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
					MIGRATE_SYNC, MR_MEMORY_HOTPLUG);
		if (ret) {
			list_for_each_entry(page, &source, lru) {
				pr_warn("migrating pfn %lx failed ret:%d ",
				if (__ratelimit(&migrate_rs)) {
					pr_warn("migrating pfn %lx failed ret:%d\n",
						page_to_pfn(page), ret);
					dump_page(page, "migration failure");
				}
			}
			putback_movable_pages(&source);
		}
	}