From: Paul E. McKenney Date: Thu, 10 Apr 2025 21:37:31 +0000 (-0700) Subject: ratelimit: Don't flush misses counter if RATELIMIT_MSG_ON_RELEASE X-Git-Tag: v6.16-rc1~178^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21ac6e5edac569df3938b136471c59c1d3d01f09;p=thirdparty%2Fkernel%2Flinux.git ratelimit: Don't flush misses counter if RATELIMIT_MSG_ON_RELEASE Restore the previous semantics where the misses counter is unchanged if the RATELIMIT_MSG_ON_RELEASE flag is set. Link: https://lore.kernel.org/all/fbe93a52-365e-47fe-93a4-44a44547d601@paulmck-laptop/ Link: https://lore.kernel.org/all/20250423115409.3425-1-spasswolf@web.de/ Signed-off-by: Paul E. McKenney Reviewed-by: Petr Mladek Cc: Andrew Morton Cc: Kuniyuki Iwashima Cc: Mateusz Guzik Cc: Steven Rostedt Cc: John Ogness Cc: Sergey Senozhatsky --- diff --git a/lib/ratelimit.c b/lib/ratelimit.c index 7d4f4e241213e..4e520d029d28f 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c @@ -92,9 +92,9 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func) atomic_set(&rs->rs_n_left, rs->burst); rs->begin = jiffies; - m = ratelimit_state_reset_miss(rs); - if (m) { - if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) { + if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) { + m = ratelimit_state_reset_miss(rs); + if (m) { printk_deferred(KERN_WARNING "%s: %d callbacks suppressed\n", func, m); }