FROMGIT: 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. Printing all the data hogs the CPU and cause some RT threads to run for a long time, which may have some bad consequences. Rate limit the page migration warnings in order to avoid this. Link: https://lkml.kernel.org/r/20210505140542.24935-1-georgi.djakov@linaro.org Signed-off-by: Liam Mark <lmark@codeaurora.org> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org> Cc: David Hildenbrand <david@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Bug: 187917022 (cherry picked from commit 6be9af0e0f77 https: //github.com/hnaz/linux-mm.git v5.13-rc1-mmots-2021-05-10-22-15) Change-Id: I6754d380f8c31cf9b699c242edacf593807ef2b1 Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
This commit is contained in:
parent
b3a1591e82
commit
4738608080
1 changed files with 11 additions and 5 deletions
|
|
@ -1318,6 +1318,8 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
|
|||
struct page *page, *head;
|
||||
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))
|
||||
|
|
@ -1364,8 +1366,10 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
|
|||
page_is_file_lru(page));
|
||||
|
||||
} else {
|
||||
pr_warn("failed to isolate pfn %lx\n", pfn);
|
||||
dump_page(page, "isolation failed");
|
||||
if (__ratelimit(&migrate_rs)) {
|
||||
pr_warn("failed to isolate pfn %lx\n", pfn);
|
||||
dump_page(page, "isolation failed");
|
||||
}
|
||||
}
|
||||
put_page(page);
|
||||
}
|
||||
|
|
@ -1394,9 +1398,11 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
|
|||
(unsigned long)&mtc, MIGRATE_SYNC, MR_MEMORY_HOTPLUG);
|
||||
if (ret) {
|
||||
list_for_each_entry(page, &source, lru) {
|
||||
pr_warn("migrating pfn %lx failed ret:%d ",
|
||||
page_to_pfn(page), ret);
|
||||
dump_page(page, "migration failure");
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue