From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,ziy@nvidia.com,vbabka@kernel.org,surenb@google.com,sj@kernel.org,rppt@kernel.org,mhocko@suse.com,ljs@kernel.org,liam@infradead.org,hannes@cmpxchg.org,david@kernel.org,brendan.jackman@linux.dev,pfalcato@suse.de,akpm@linux-foundation.org
Subject: [merged mm-stable] mm-replace-custom-bad-page-map-ratelimiting-logic.patch removed from -mm tree
Date: Tue, 06 Oct 2026 17:50:58 -0700 [thread overview]
Message-ID: <20261007005059.442991F0089B@smtp.kernel.org> (raw)
The quilt patch titled
Subject: mm: replace custom bad page map ratelimiting logic
has been removed from the -mm tree. Its filename was
mm-replace-custom-bad-page-map-ratelimiting-logic.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Pedro Falcato <pfalcato@suse.de>
Subject: mm: replace custom bad page map ratelimiting logic
Date: Tue, 11 Aug 2026 18:21:55 +0100
Patch series "mm: replace custom ratelimiting logic".
The kernel has a perfectly cromulent and mostly-equivalent variant in
lib/ratelimit.c that can be used.
This patch (of 2):
The current logic (allow up to $BURST prints per minute) can be entirely
replaced by the generic version in lib/ratelimit.c, used around the
kernel.
Do so. The only functional difference should be that the new logs will
read something like:
KERN_WARNING "print_bad_page_map: %d callbacks suppressed\n", ...
But that should be fine enough.
Link: https://lore.kernel.org/20260811172156.356053-1-pfalcato@suse.de
Link: https://lore.kernel.org/20260811172156.356053-2-pfalcato@suse.de
Signed-off-by: Pedro Falcato <pfalcato@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: SJ Park <sj@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
---
mm/memory.c | 30 +++---------------------------
1 file changed, 3 insertions(+), 27 deletions(-)
--- a/mm/memory.c~mm-replace-custom-bad-page-map-ratelimiting-logic
+++ a/mm/memory.c
@@ -492,32 +492,8 @@ static inline void add_mm_rss_vec(struct
add_mm_counter(mm, i, rss[i]);
}
-static bool is_bad_page_map_ratelimited(void)
-{
- static unsigned long resume;
- static unsigned long nr_shown;
- static unsigned long nr_unshown;
-
- /*
- * Allow a burst of 60 reports, then keep quiet for that minute;
- * or allow a steady drip of one report per second.
- */
- if (nr_shown == 60) {
- if (time_before(jiffies, resume)) {
- nr_unshown++;
- return true;
- }
- if (nr_unshown) {
- pr_alert("BUG: Bad page map: %lu messages suppressed\n",
- nr_unshown);
- nr_unshown = 0;
- }
- nr_shown = 0;
- }
- if (nr_shown++ == 0)
- resume = jiffies + 60 * HZ;
- return false;
-}
+/* Allow a burst of 60 bad page map reports per minute. */
+static DEFINE_RATELIMIT_STATE(bad_page_map_ratelimit, 60 * HZ, 60);
static void ptval_bytes_to_hex_str(char *buf, size_t buf_size, const void *entry, size_t entry_size)
{
@@ -633,7 +609,7 @@ static void print_bad_page_map(struct vm
char entry_str[PTVAL_STR_MAX];
pgoff_t index, anon_index;
- if (is_bad_page_map_ratelimited())
+ if (!__ratelimit(&bad_page_map_ratelimit))
return;
mapping = vma->vm_file ? vma->vm_file->f_mapping : NULL;
_
Patches currently in -mm which might be from pfalcato@suse.de are
reply other threads:[~2026-10-07 0:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261007005059.442991F0089B@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=brendan.jackman@linux.dev \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=liam@infradead.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=mm-commits@vger.kernel.org \
--cc=pfalcato@suse.de \
--cc=rppt@kernel.org \
--cc=sj@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.