Skip to content

Commit 29fc5f9

Browse files
committed
rcu: Force DEFAULT_RCU_BLIMIT to 1000 for strict RCU GPs
The value of DEFAULT_RCU_BLIMIT is normally set to 10, the idea being to avoid needless response-time degradation due to RCU callback invocation. However, when CONFIG_RCU_STRICT_GRACE_PERIOD=y it is better to avoid throttling callback execution in order to better detect pointer leaks from RCU read-side critical sections. This commit therefore sets the value of DEFAULT_RCU_BLIMIT to 1000 in kernels built with CONFIG_RCU_STRICT_GRACE_PERIOD=y. Reported-by Jann Horn <jannh@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent aecd34b commit 29fc5f9

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎kernel/rcu/tree.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,17 +468,18 @@ static int rcu_is_cpu_rrupt_from_idle(void)
468468
return __this_cpu_read(rcu_data.dynticks_nesting) == 0;
469469
}
470470

471-
#define DEFAULT_RCU_BLIMIT 10 /* Maximum callbacks per rcu_do_batch ... */
472-
#define DEFAULT_MAX_RCU_BLIMIT 10000 /* ... even during callback flood. */
471+
#define DEFAULT_RCU_BLIMIT (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) ? 1000 : 10)
472+
// Maximum callbacks per rcu_do_batch ...
473+
#define DEFAULT_MAX_RCU_BLIMIT 10000 // ... even during callback flood.
473474
static long blimit = DEFAULT_RCU_BLIMIT;
474-
#define DEFAULT_RCU_QHIMARK 10000 /* If this many pending, ignore blimit. */
475+
#define DEFAULT_RCU_QHIMARK 10000 // If this many pending, ignore blimit.
475476
static long qhimark = DEFAULT_RCU_QHIMARK;
476-
#define DEFAULT_RCU_QLOMARK 100 /* Once only this many pending, use blimit. */
477+
#define DEFAULT_RCU_QLOMARK 100 // Once only this many pending, use blimit.
477478
static long qlowmark = DEFAULT_RCU_QLOMARK;
478479
#define DEFAULT_RCU_QOVLD_MULT 2
479480
#define DEFAULT_RCU_QOVLD (DEFAULT_RCU_QOVLD_MULT * DEFAULT_RCU_QHIMARK)
480-
static long qovld = DEFAULT_RCU_QOVLD; /* If this many pending, hammer QS. */
481-
static long qovld_calc = -1; /* No pre-initialization lock acquisitions! */
481+
static long qovld = DEFAULT_RCU_QOVLD; // If this many pending, hammer QS.
482+
static long qovld_calc = -1; // No pre-initialization lock acquisitions!
482483

483484
module_param(blimit, long, 0444);
484485
module_param(qhimark, long, 0444);

0 commit comments

Comments
 (0)