From: "Paul E. McKenney" <paulmck@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: kernel-team@meta.com, "Paul E. McKenney" <paulmck@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Kuniyuki Iwashima <kuniyu@amazon.com>,
Mateusz Guzik <mjguzik@gmail.com>, Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Jon Pan-Doh <pandoh@google.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Karolina Stolarek <karolina.stolarek@oracle.com>
Subject: [PATCH RFC 8/9] ratelimit: Reduce ratelimit's false-positive misses
Date: Thu, 3 Apr 2025 14:15:13 -0700 [thread overview]
Message-ID: <20250403211514.985900-8-paulmck@kernel.org> (raw)
In-Reply-To: <fbe93a52-365e-47fe-93a4-44a44547d601@paulmck-laptop>
The current ratelimit implementation can suffer from false-positive
misses. That is, ___ratelimit() might return zero (causing the caller
to invoke rate limiting, for example, by dropping printk()s) even when
the current burst has not yet been consumed. This happens when one CPU
holds a given ratelimit structure's lock and some other CPU concurrently
invokes ___ratelimit(). The fact that the lock is a raw irq-disabled
spinlock might make low-contention trylock failure seem unlikely, but
vCPU preemption, NMIs, and firmware interrupts can greatly extend the
trylock-failure window.
Avoiding these false-positive misses is especially important when
correlating console logged hardware failures with other information.
Therefore, instead of attempting to acquire the lock on each call to
___ratelimit(), construct a lockless fastpath and only acquire the lock
when retriggering (for the next burst) or when resynchronizing (due to
either a long idle period or due to ratelimiting having been disabled).
This reduces the number of lock-hold periods that can be extended
by vCPU preemption, NMIs and firmware interrupts, but also means that
these extensions must be of much longer durations (generally moving from
milliseconds to seconds) before they can result in false-positive drops.
In addition, the lockless fastpath gets a 10-20% speedup compared to
the old fully locked code on my x86 laptop. Your mileage will of course
vary depending on your hardware, workload, and configuration.
[ paulmck: Apply feedback from Dan Carpenter. ]
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Jon Pan-Doh <pandoh@google.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Karolina Stolarek <karolina.stolarek@oracle.com>
---
include/linux/ratelimit.h | 2 +-
include/linux/ratelimit_types.h | 3 +-
lib/ratelimit.c | 176 +++++++++++++++++++++++++-------
3 files changed, 144 insertions(+), 37 deletions(-)
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index adfec24061d16..7aaad158ee373 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);
}
diff --git a/include/linux/ratelimit_types.h b/include/linux/ratelimit_types.h
index ef6711b6b229f..2f38345ffc1a5 100644
--- a/include/linux/ratelimit_types.h
+++ b/include/linux/ratelimit_types.h
@@ -18,7 +18,7 @@ struct ratelimit_state {
int interval;
int burst;
- int printed;
+ atomic_t rs_n_left;
atomic_t missed;
unsigned int flags;
unsigned long begin;
@@ -28,6 +28,7 @@ struct ratelimit_state {
.lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
.interval = interval_init, \
.burst = burst_init, \
+ .rs_n_left = ATOMIC_INIT(burst_init), \
.flags = flags_init, \
}
diff --git a/lib/ratelimit.c b/lib/ratelimit.c
index bd6e3b429e333..03704c6f8899e 100644
--- a/lib/ratelimit.c
+++ b/lib/ratelimit.c
@@ -26,55 +26,161 @@
*/
int ___ratelimit(struct ratelimit_state *rs, const char *func)
{
- /* Paired with WRITE_ONCE() in .proc_handler().
- * Changing two values seperately could be inconsistent
- * and some message could be lost. (See: net_ratelimit_state).
- */
- int interval = READ_ONCE(rs->interval);
+ unsigned long begin;
int burst = READ_ONCE(rs->burst);
+ int delta = 0;
unsigned long flags;
- int ret;
-
- if (!interval)
- return 1;
+ bool gotlock = false;
+ bool initialized;
+ int interval = READ_ONCE(rs->interval);
+ unsigned long j;
+ int n_left;
/*
- * If we contend on this state's lock then almost
- * by definition we are too busy to print a message,
- * in addition to the one that will be printed by
- * the entity that is holding the lock already:
+ * If the burst or interval settings mark this ratelimit_state
+ * structure as disabled, then clear the RATELIMIT_INITIALIZED bit
+ * in ->flags to force resetting of the ratelimiting interval when
+ * this ratelimit_state structure is next re-enabled.
*/
- if (!raw_spin_trylock_irqsave(&rs->lock, flags)) {
- ratelimit_state_inc_miss(rs);
- return 0;
+ if (burst <= 0 || interval <= 0) {
+ if ((READ_ONCE(rs->flags) & RATELIMIT_INITIALIZED) &&
+ raw_spin_trylock_irqsave(&rs->lock, flags)) {
+ if (READ_ONCE(rs->flags) & RATELIMIT_INITIALIZED)
+ smp_store_release(&rs->flags, rs->flags & ~RATELIMIT_INITIALIZED);
+ raw_spin_unlock_irqrestore(&rs->lock, flags);
+ }
+ return true;
}
- if (!(rs->flags & RATELIMIT_INITIALIZED)) {
- rs->begin = jiffies;
- rs->flags |= RATELIMIT_INITIALIZED;
+ /*
+ * If this structure has just now been ratelimited, but not yet
+ * reset for the next rate-limiting interval, take an early and
+ * low-cost exit.
+ */
+ if (atomic_read_acquire(&rs->rs_n_left) <= 0) /* Pair with release. */
+ goto limited;
+
+ /*
+ * If this structure is marked as initialized and has been
+ * recently used, pick up its ->begin field. Otherwise, pick up
+ * the current time and attempt to re-initialized the structure.
+ */
+ j = jiffies;
+ initialized = smp_load_acquire(&rs->flags) & RATELIMIT_INITIALIZED; /* Pair with release. */
+ if (initialized) {
+ begin = READ_ONCE(rs->begin);
+ } else {
+ /*
+ * Uninitialized or long idle, so reset ->begin and
+ * mark initialized. If we fail to acquire the lock,
+ * let the lock holder do the work.
+ */
+ begin = j;
+ if (raw_spin_trylock_irqsave(&rs->lock, flags)) {
+ if (!(READ_ONCE(rs->flags) & RATELIMIT_INITIALIZED)) {
+ begin = jiffies;
+ j = begin;
+ WRITE_ONCE(rs->begin, begin);
+ smp_store_release(&rs->flags, /* Pair with acquire. */
+ rs->flags | RATELIMIT_INITIALIZED);
+ initialized = true;
+ }
+ raw_spin_unlock_irqrestore(&rs->lock, flags);
+ }
}
- if (time_is_before_jiffies(rs->begin + interval)) {
- int m = ratelimit_state_reset_miss(rs);
+ /*
+ * If this structure is still in the interval in which has
+ * already hit the rate limit, take an early and low-cost exit.
+ */
+ if (initialized && time_before(begin - 2 * interval, j) && time_before(j, begin))
+ goto limited;
- if (m) {
- if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) {
- printk_deferred(KERN_WARNING
- "%s: %d callbacks suppressed\n", func, m);
- }
+ /*
+ * Register another request, and take an early (but not low-cost)
+ * exit if rate-limiting just nowcame into effect.
+ */
+ n_left = atomic_dec_return(&rs->rs_n_left);
+ if (n_left < 0)
+ goto limited; /* Just now started ratelimiting. */
+ if (n_left > 0) {
+ /*
+ * Otherwise, there is not yet any rate limiting for the
+ * current interval, and furthermore there is at least one
+ * last count remaining. But check to see if initialization
+ * is required or if we have run off the end of the interval
+ * without rate limiting having been imposed. Either way,
+ * we eventually return @true to tell our caller to go ahead.
+ */
+ if (initialized &&
+ time_before(begin - interval, j) && time_before(j, begin + interval))
+ return true; /* Nothing special to do. */
+ if (!raw_spin_trylock_irqsave(&rs->lock, flags))
+ return true; /* Let lock holder do special work. */
+ interval = READ_ONCE(rs->interval);
+ begin = rs->begin;
+ initialized = smp_load_acquire(&rs->flags) & RATELIMIT_INITIALIZED;
+ if (interval <= 0 ||
+ (initialized &&
+ time_before(begin - interval, j) && time_before(j, begin + interval))) {
+ /*
+ * Someone else beat us to the special work,
+ * so release the lock and return.
+ */
+ raw_spin_unlock_irqrestore(&rs->lock, flags);
+ return true;
}
- rs->begin = jiffies;
- rs->printed = 0;
+
+ /* We have the lock and will do initialization. */
+ gotlock = true;
+ delta = -1;
}
- if (burst && burst > rs->printed) {
- rs->printed++;
- ret = 1;
- } else {
- ratelimit_state_inc_miss(rs);
- ret = 0;
+ if (!gotlock) {
+ /*
+ * We get here if we got the last count (n_left == 0),
+ * so that rate limiting is in effect for the next caller.
+ * We will return @true to tell our caller to go ahead,
+ * but first we acquire the lock and set things up for
+ * the next rate-limiting interval.
+ */
+ raw_spin_lock_irqsave(&rs->lock, flags);
+ interval = READ_ONCE(rs->interval);
+ j = jiffies;
+ begin = rs->begin;
+ initialized = smp_load_acquire(&rs->flags) & RATELIMIT_INITIALIZED;
+ }
+ burst = READ_ONCE(rs->burst);
+ if (interval <= 0 || !initialized ||
+ time_after(j, begin + interval) || time_after(begin - interval, j))
+ begin = j; /* Long delay, reset interval. */
+ else
+ begin += interval; /* Next interval. */
+
+ /*
+ * If an acquire sees the value stored by either of these two
+ * store-release operations, it will also see the value from
+ * following store to ->begin, or from some later store. But not
+ * from any earlier now-obsolete earlier store to ->begin.
+ */
+ WRITE_ONCE(rs->begin, begin);
+ atomic_set_release(&rs->rs_n_left, burst + delta); /* Pair with acquire.*/
+ smp_store_release(&rs->flags, rs->flags | RATELIMIT_INITIALIZED); /* ^^^ */
+
+ /* Print suppressed callback count if requested. */
+ if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) {
+ delta = ratelimit_state_reset_miss(rs);
+ if (delta)
+ printk_deferred(KERN_WARNING "%s: %d callbacks suppressed\n", func, delta);
}
raw_spin_unlock_irqrestore(&rs->lock, flags);
+ return true;
- return ret;
+limited:
+ /*
+ * Count the number of rate-limited requests and tell the caller
+ * that this is a no-go.
+ */
+ ratelimit_state_inc_miss(rs);
+ return false;
}
EXPORT_SYMBOL(___ratelimit);
--
2.40.1
next prev parent reply other threads:[~2025-04-03 21:15 UTC|newest]
Thread overview: 137+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 21:14 [PATCH RFC 0/9] " Paul E. McKenney
2025-04-03 21:15 ` [PATCH RFC 1/9] ratelimit: Create functions to handle ratelimit_state internals Paul E. McKenney
2025-04-03 21:15 ` [PATCH RFC 2/9] random: Avoid open-coded use of ratelimit_state structure's ->missed field Paul E. McKenney
2025-04-03 21:15 ` [PATCH RFC 3/9] drm/i915: " Paul E. McKenney
2025-04-03 21:15 ` [PATCH RFC 4/9] drm/amd/pm: Avoid open-coded use of ratelimit_state structure's internals Paul E. McKenney
2025-04-07 14:35 ` Deucher, Alexander
2025-04-07 16:29 ` Paul E. McKenney
2025-04-03 21:15 ` [PATCH RFC 5/9] ratelimit: Convert the ->missed field to atomic_t Paul E. McKenney
2025-04-03 21:15 ` [PATCH RFC 6/9] ratelimit: Count misses due to lock contention Paul E. McKenney
2025-04-03 21:15 ` [PATCH RFC 7/9] ratelimit: Avoid jiffies=0 special case Paul E. McKenney
2025-04-03 21:15 ` Paul E. McKenney [this message]
2025-04-05 9:17 ` [PATCH RFC 8/9] ratelimit: Reduce ratelimit's false-positive misses Mateusz Guzik
2025-04-06 17:41 ` Paul E. McKenney
2025-04-07 0:07 ` Mateusz Guzik
2025-04-07 16:54 ` Paul E. McKenney
2025-04-08 16:41 ` Petr Mladek
2025-04-08 17:56 ` Paul E. McKenney
2025-04-03 21:15 ` [PATCH RFC 9/9] lib: Add trivial kunit test for ratelimit Paul E. McKenney
2025-04-18 17:13 ` [PATCH RFC 0/9] Reduce ratelimit's false-positive misses Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 01/14] lib: Add trivial kunit test for ratelimit Paul E. McKenney
2025-04-22 14:44 ` Petr Mladek
2025-04-22 22:56 ` Paul E. McKenney
2025-04-23 9:36 ` Petr Mladek
2025-04-18 17:13 ` [PATCH v2 ratelimit 02/14] ratelimit: Create functions to handle ratelimit_state internals Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 03/14] random: Avoid open-coded use of ratelimit_state structure's ->missed field Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 04/14] drm/i915: " Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 05/14] drm/amd/pm: Avoid open-coded use of ratelimit_state structure's internals Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 06/14] ratelimit: Convert the ->missed field to atomic_t Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 07/14] ratelimit: Count misses due to lock contention Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 08/14] ratelimit: Avoid jiffies=0 special case Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 09/14] ratelimit: Reduce ___ratelimit() false-positive rate limiting Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 10/14] ratelimit: Allow zero ->burst to disable ratelimiting Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 11/14] ratelimit: Force re-initialization when rate-limiting re-enabled Paul E. McKenney
2025-04-23 15:59 ` Mark Brown
2025-04-23 18:20 ` Paul E. McKenney
2025-04-23 18:59 ` Mark Brown
2025-04-23 19:54 ` Paul E. McKenney
2025-04-24 12:11 ` Mark Brown
2025-04-24 14:48 ` Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 12/14] ratelimit: Don't flush misses counter if RATELIMIT_MSG_ON_RELEASE Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 13/14] ratelimit: Avoid atomic decrement if already rate-limited Paul E. McKenney
2025-04-18 17:13 ` [PATCH v2 ratelimit 14/14] ratelimit: Avoid atomic decrement under lock " Paul E. McKenney
2025-04-22 14:50 ` [PATCH RFC 0/9] Reduce ratelimit's false-positive misses Petr Mladek
2025-04-22 14:57 ` Paul E. McKenney
2025-04-25 0:27 ` Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 01/20] lib: Add trivial kunit test for ratelimit Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 02/20] ratelimit: Create functions to handle ratelimit_state internals Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 03/20] random: Avoid open-coded use of ratelimit_state structure's ->missed field Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 04/20] drm/i915: " Paul E. McKenney
2025-04-25 8:48 ` Jani Nikula
2025-04-25 14:27 ` Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 05/20] drm/amd/pm: Avoid open-coded use of ratelimit_state structure's internals Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 06/20] ratelimit: Convert the ->missed field to atomic_t Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 07/20] ratelimit: Count misses due to lock contention Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 08/20] ratelimit: Avoid jiffies=0 special case Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 09/20] ratelimit: Reduce ___ratelimit() false-positive rate limiting Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 10/20] ratelimit: Allow zero ->burst to disable ratelimiting Paul E. McKenney
2025-04-28 14:57 ` Petr Mladek
2025-04-28 19:50 ` Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 11/20] ratelimit: Force re-initialization when rate-limiting re-enabled Paul E. McKenney
2025-04-28 15:33 ` Petr Mladek
2025-04-28 19:49 ` Paul E. McKenney
2025-04-29 12:05 ` Petr Mladek
2025-04-29 18:47 ` Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 12/20] ratelimit: Don't flush misses counter if RATELIMIT_MSG_ON_RELEASE Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 13/20] ratelimit: Avoid atomic decrement if already rate-limited Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 14/20] ratelimit: Avoid atomic decrement under lock " Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 15/20] ratelimit: Warn if ->interval or ->burst are negative Paul E. McKenney
2025-04-29 12:23 ` Petr Mladek
2025-04-29 18:52 ` Paul E. McKenney
2025-04-25 0:28 ` [PATCH v3 16/20] ratelimit: Simplify common-case exit path Paul E. McKenney
2025-04-29 14:25 ` Petr Mladek
2025-04-25 0:28 ` [PATCH v3 17/20] ratelimit: Use nolock_ret label to save a couple of lines of code Paul E. McKenney
2025-04-29 14:26 ` Petr Mladek
2025-04-25 0:28 ` [PATCH v3 18/20] ratelimit: Use nolock_ret label to collapse lock-failure code Paul E. McKenney
2025-04-29 14:31 ` Petr Mladek
2025-04-25 0:28 ` [PATCH v3 19/20] ratelimit: Use nolock_ret restructuring to collapse common case code Paul E. McKenney
2025-04-29 14:37 ` Petr Mladek
2025-04-25 0:28 ` [PATCH v3 20/20] ratelimit: Drop redundant accesses to burst Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 0/20] ratelimit: Reduce ratelimit's false-positive misses Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 01/20] lib: Add trivial kunit test for ratelimit Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 02/20] ratelimit: Create functions to handle ratelimit_state internals Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 03/20] random: Avoid open-coded use of ratelimit_state structure's ->missed field Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 04/20] drm/i915: " Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 05/20] drm/amd/pm: Avoid open-coded use of ratelimit_state structure's internals Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 06/20] ratelimit: Convert the ->missed field to atomic_t Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 07/20] ratelimit: Count misses due to lock contention Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 08/20] ratelimit: Avoid jiffies=0 special case Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 09/20] ratelimit: Reduce ___ratelimit() false-positive rate limiting Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 10/20] ratelimit: Allow zero ->burst to disable ratelimiting Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 11/20] ratelimit: Force re-initialization when rate-limiting re-enabled Paul E. McKenney
2025-05-05 10:20 ` Petr Mladek
2025-04-30 1:05 ` [PATCH v4 12/20] ratelimit: Don't flush misses counter if RATELIMIT_MSG_ON_RELEASE Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 13/20] ratelimit: Avoid atomic decrement if already rate-limited Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 14/20] ratelimit: Avoid atomic decrement under lock " Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 15/20] ratelimit: Warn if ->interval or ->burst are negative Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 16/20] ratelimit: Simplify common-case exit path Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 17/20] ratelimit: Use nolock_ret label to save a couple of lines of code Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 18/20] ratelimit: Use nolock_ret label to collapse lock-failure code Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 19/20] ratelimit: Use nolock_ret restructuring to collapse common case code Paul E. McKenney
2025-04-30 1:05 ` [PATCH v4 20/20] ratelimit: Drop redundant accesses to burst Paul E. McKenney
2025-05-05 11:14 ` Petr Mladek
2025-05-05 11:37 ` [PATCH v4 0/20] ratelimit: Reduce ratelimit's false-positive misses Petr Mladek
2025-05-05 15:52 ` Paul E. McKenney
2025-05-08 23:32 ` [PATCH v5 0/21] " Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 01/21] ratelimit: Create functions to handle ratelimit_state internals Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 02/21] random: Avoid open-coded use of ratelimit_state structure's ->missed field Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 03/21] drm/i915: " Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 04/21] drm/amd/pm: Avoid open-coded use of ratelimit_state structure's internals Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 05/21] ratelimit: Convert the ->missed field to atomic_t Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 06/21] ratelimit: Count misses due to lock contention Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 07/21] ratelimit: Avoid jiffies=0 special case Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 08/21] ratelimit: Reduce ___ratelimit() false-positive rate limiting Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 09/21] ratelimit: Allow zero ->burst to disable ratelimiting Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 10/21] ratelimit: Force re-initialization when rate-limiting re-enabled Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 11/21] ratelimit: Don't flush misses counter if RATELIMIT_MSG_ON_RELEASE Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 12/21] ratelimit: Avoid atomic decrement if already rate-limited Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 13/21] ratelimit: Avoid atomic decrement under lock " Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 14/21] ratelimit: Warn if ->interval or ->burst are negative Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 15/21] ratelimit: Simplify common-case exit path Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 16/21] ratelimit: Use nolock_ret label to save a couple of lines of code Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 17/21] ratelimit: Use nolock_ret label to collapse lock-failure code Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 18/21] ratelimit: Use nolock_ret restructuring to collapse common case code Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 19/21] ratelimit: Drop redundant accesses to burst Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 20/21] lib: Add trivial kunit test for ratelimit Paul E. McKenney
2025-05-12 15:22 ` Petr Mladek
2025-05-13 21:17 ` Paul E. McKenney
2025-05-08 23:33 ` [PATCH v5 21/21] lib: Add stress " Paul E. McKenney
2025-07-09 18:00 ` [PATCH v6 0/3] ratelimit: Add tests for lib/ratelimit.c Paul E. McKenney
2025-07-09 18:03 ` [PATCH v6 1/3] lib: Add trivial kunit test for ratelimit Paul E. McKenney
2025-07-09 22:41 ` Andrew Morton
2025-07-09 22:46 ` Steven Rostedt
2025-07-09 23:01 ` Paul E. McKenney
2025-07-09 18:03 ` [PATCH v6 2/3] lib: Make the ratelimit test more reliable Paul E. McKenney
2025-07-09 22:44 ` Andrew Morton
2025-07-09 23:02 ` Paul E. McKenney
2025-07-09 18:03 ` [PATCH v6 3/3] lib: Add stress test for ratelimit Paul E. McKenney
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=20250403211514.985900-8-paulmck@kernel.org \
--to=paulmck@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=john.ogness@linutronix.de \
--cc=karolina.stolarek@oracle.com \
--cc=kernel-team@meta.com \
--cc=kuniyu@amazon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.com \
--cc=pandoh@google.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®