Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: ratelimit min_free_kbytes adjustment messages

The "raising min_free_kbytes" pr_info message in
set_recommended_min_free_kbytes() and the "min_free_kbytes is not updated
to" pr_warn in calculate_min_free_kbytes() can spam the kernel log when
called repeatedly.

Switch the pr_info in set_recommended_min_free_kbytes() and the pr_warn in
calculate_min_free_kbytes() to their _ratelimited variants to prevent the
log spam for this message.

Link: https://lkml.kernel.org/r/20260317-thp_logs-v7-4-31eb98fa5a8b@debian.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: Zi Yan <ziy@nvidia.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nico Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Breno Leitao and committed by
Andrew Morton
3203a870 35a01d94

+4 -4
+2 -2
mm/khugepaged.c
··· 2701 2701 2702 2702 if (recommended_min > min_free_kbytes) { 2703 2703 if (user_min_free_kbytes >= 0) 2704 - pr_info("raising min_free_kbytes from %d to %lu to help transparent hugepage allocations\n", 2705 - min_free_kbytes, recommended_min); 2704 + pr_info_ratelimited("raising min_free_kbytes from %d to %lu to help transparent hugepage allocations\n", 2705 + min_free_kbytes, recommended_min); 2706 2706 2707 2707 min_free_kbytes = recommended_min; 2708 2708 }
+2 -2
mm/page_alloc.c
··· 6514 6514 if (new_min_free_kbytes > user_min_free_kbytes) 6515 6515 min_free_kbytes = clamp(new_min_free_kbytes, 128, 262144); 6516 6516 else 6517 - pr_warn("min_free_kbytes is not updated to %d because user defined value %d is preferred\n", 6518 - new_min_free_kbytes, user_min_free_kbytes); 6517 + pr_warn_ratelimited("min_free_kbytes is not updated to %d because user defined value %d is preferred\n", 6518 + new_min_free_kbytes, user_min_free_kbytes); 6519 6519 6520 6520 } 6521 6521