Re: [PATCH] printk: fold consecutive duplicate messages

From: Lin Junzhe

Date: Mon Sep 21 2026 - 08:30:46 EST


Hi John,

Thanks for the detailed follow-up, and for taking the time to check
each of my examples against the actual source.

You are right on all counts. In every case I cited, the repeated
format string is interleaved with other messages, so a "consecutive
duplicate" check would not have helped. More fundamentally, your
point that "same format string does not mean same data" exposes a
real flaw in my implementation: the dedup key hashes only the fmt
pointer and facility/level, not the arguments (a va_list can only be
consumed once), so two messages with different argument values would
be wrongly folded. That alone makes the patch incorrect for exactly
the scenarios it was meant to address.

I also accept the broader point: a message that is spammy enough to
flood the console should be fixed at its source with a ratelimited
or once-per-event variant, rather than papered over in printk.

So I am withdrawing this patch:

https://lore.kernel.org/lkml/20260921050304.73440-1-m18667909625@xxxxxxx/

Thank you and Petr for the reviews -- the "printk must remain lockless
and NMI-safe" invariant, and the guidance on where a feature like this
would have to live (store phase, exact-content match, LOG_CONT-style
ordering) were valuable lessons.

Best regards,
Lin Junzhe

--
Assisted-by: AI coding assistant (disclosed per kernel AI guidelines)