From: Greg Kroah-Hartman Date: Fri, 20 Oct 2023 14:26:16 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.14.328~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41a3df75d5b96fdd988750c2ef048871cb3cc66b;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: mm-memory_hotplug-rate-limit-page-migration-warnings.patch --- diff --git a/queue-5.10/mm-memory_hotplug-rate-limit-page-migration-warnings.patch b/queue-5.10/mm-memory_hotplug-rate-limit-page-migration-warnings.patch new file mode 100644 index 00000000000..12853c0ff0c --- /dev/null +++ b/queue-5.10/mm-memory_hotplug-rate-limit-page-migration-warnings.patch @@ -0,0 +1,67 @@ +From 786dee864804f8e851cf0f258df2ccbb4ee03d80 Mon Sep 17 00:00:00 2001 +From: Liam Mark +Date: Wed, 30 Jun 2021 18:52:43 -0700 +Subject: mm/memory_hotplug: rate limit page migration warnings + +From: Liam Mark + +commit 786dee864804f8e851cf0f258df2ccbb4ee03d80 upstream. + +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 +Signed-off-by: Georgi Djakov +Cc: David Hildenbrand +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Cc: +Signed-off-by: Greg Kroah-Hartman +--- + mm/memory_hotplug.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/mm/memory_hotplug.c ++++ b/mm/memory_hotplug.c +@@ -1279,6 +1279,8 @@ do_migrate_range(unsigned long start_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)) +@@ -1325,8 +1327,10 @@ do_migrate_range(unsigned long start_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); + } +@@ -1355,9 +1359,11 @@ do_migrate_range(unsigned long start_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); + } diff --git a/queue-5.10/series b/queue-5.10/series index ba420a23c1f..bc46ea16ee8 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -82,3 +82,4 @@ rdma-srp-fix-srp_abort.patch ravb-fix-use-after-free-issue-in-ravb_tx_timeout_work.patch dev_forward_skb-do-not-scrub-skb-mark-within-the-same-name-space.patch lib-kconfig.debug-do-not-enable-debug_preempt-by-default.patch +mm-memory_hotplug-rate-limit-page-migration-warnings.patch