diff options
author | 2025-04-09 16:54:33 -0700 | |
---|---|---|
committer | 2025-05-08 16:13:27 -0700 | |
commit | cf8cfa8a9978bfe77f2648a04824a46d58258e68 (patch) | |
tree | 328c6dee3e336766cfb2f3682c86a3b8da192e86 /include/linux/ratelimit.h | |
parent | ratelimit: Avoid jiffies=0 special case (diff) | |
download | wireguard-linux-cf8cfa8a9978bfe77f2648a04824a46d58258e68.tar.xz wireguard-linux-cf8cfa8a9978bfe77f2648a04824a46d58258e68.zip |
ratelimit: Reduce ___ratelimit() false-positive rate limiting
Retain the locked design, but check rate-limiting even when the lock
could not be acquired.
Link: https://lore.kernel.org/all/Z_VRo63o2UsVoxLG@pathway.suse.cz/
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: Petr Mladek <pmladek@suse.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Diffstat (limited to 'include/linux/ratelimit.h')
-rw-r--r-- | include/linux/ratelimit.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index adfec24061d1..7aaad158ee37 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h @@ -44,7 +44,7 @@ static inline void ratelimit_state_reset_interval(struct ratelimit_state *rs, in raw_spin_lock_irqsave(&rs->lock, flags); rs->interval = interval_init; rs->flags &= ~RATELIMIT_INITIALIZED; - rs->printed = 0; + atomic_set(&rs->rs_n_left, rs->burst); ratelimit_state_reset_miss(rs); raw_spin_unlock_irqrestore(&rs->lock, flags); } |