Merge tag 'rcu-fixes.v7.4-20261115a' of git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux

Pull RCU fixes from Joel Fernandes:
 "Fix a build break with recent clang, which warns about unsequenced
  accesses to the volatile jiffies variable in show_rcu_nocb_state() and
  fails the build with CONFIG_WERROR=y / W=e. Read jiffies once into a
  local variable instead.

  Also replace the rcupdate.rcu_task_collapse_debug module parameter,
  added in the v7.4 merge window, with pr_debug() for the RCU Tasks
  callback contend/collapse messages. The messages stay off by default
  and can be enabled with dynamic debug, and no official kernel carries
  the extra parameter"

* tag 'rcu-fixes.v7.4-20261115a' of git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux:
  rcu/nocb: Avoid unsequenced accesses to jiffies in show_rcu_nocb_state()
  rcu-tasks: Use pr_debug() for callback contend/collapse messages
This commit is contained in:
Linus Torvalds
2026-11-16 07:26:07 -08:00
3 changed files with 7 additions and 21 deletions
@@ -6369,13 +6369,6 @@ Kernel parameters
period to instead use normal non-expedited
grace-period processing.
rcupdate.rcu_task_collapse_debug= [KNL]
Enable debugging prints that record when RCU Tasks
and RCU Tasks Trace expand to per-CPU callback
queuing and collapse back to CPU-0 queuing.
This is default-disabled due to the fact that
some workloads can make it quite noisy.
rcupdate.rcu_task_collapse_lim= [KNL]
Set the maximum number of callbacks present
at the beginning of a grace period that allows
+3 -12
View File
@@ -178,8 +178,6 @@ static int rcu_task_contend_lim __read_mostly = 100;
module_param(rcu_task_contend_lim, int, 0444);
static int rcu_task_collapse_lim __read_mostly = 10;
module_param(rcu_task_collapse_lim, int, 0444);
static bool rcu_task_collapse_debug __read_mostly;
module_param(rcu_task_collapse_debug, bool, 0644);
static int rcu_task_lazy_lim __read_mostly = 32;
module_param(rcu_task_lazy_lim, int, 0444);
@@ -392,8 +390,7 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func,
WRITE_ONCE(rtp->percpu_enqueue_shift, 0);
WRITE_ONCE(rtp->percpu_dequeue_lim, rcu_task_cpu_ids);
smp_store_release(&rtp->percpu_enqueue_lim, rcu_task_cpu_ids);
if (data_race(rcu_task_collapse_debug))
pr_info("Switching %s to per-CPU callback queuing.\n", rtp->name);
pr_debug("Switching %s to per-CPU callback queuing.\n", rtp->name);
}
raw_spin_unlock_irqrestore(&rtp->cbs_gbl_lock, flags);
}
@@ -514,9 +511,7 @@ static int rcu_tasks_need_gpcb(struct rcu_tasks *rtp)
smp_store_release(&rtp->percpu_enqueue_lim, 1);
rtp->percpu_dequeue_gpseq = get_state_synchronize_rcu();
gpdone = false;
if (data_race(rcu_task_collapse_debug))
pr_info("Starting switch %s to CPU-0 callback queuing.\n",
rtp->name);
pr_debug("Starting switch %s to CPU-0 callback queuing.\n", rtp->name);
}
raw_spin_unlock_irqrestore(&rtp->cbs_gbl_lock, flags);
}
@@ -524,9 +519,7 @@ static int rcu_tasks_need_gpcb(struct rcu_tasks *rtp)
raw_spin_lock_irqsave(&rtp->cbs_gbl_lock, flags);
if (rtp->percpu_enqueue_lim < rtp->percpu_dequeue_lim) {
WRITE_ONCE(rtp->percpu_dequeue_lim, 1);
if (data_race(rcu_task_collapse_debug))
pr_info("Completing switch %s to CPU-0 callback queuing.\n",
rtp->name);
pr_debug("Completing switch %s to CPU-0 callback queuing.\n", rtp->name);
}
if (rtp->percpu_dequeue_lim == 1) {
for (cpu = rtp->percpu_dequeue_lim; cpu < rcu_task_cpu_ids; cpu++) {
@@ -711,8 +704,6 @@ static void __init rcu_tasks_bootup_oddness(void)
pr_info("\tTasks-RCU CPU stall info multiplier clamped to %d (rcu_task_stall_info_mult).\n", rtsimc);
rcu_task_stall_info_mult = rtsimc;
}
if (rcu_task_collapse_debug)
pr_info("\tTasks-RCU callback contend/collapse debug enabled.\n");
#endif /* #ifdef CONFIG_TASKS_RCU */
#ifdef CONFIG_TASKS_RCU
pr_info("\tTrampoline variant of Tasks RCU enabled.\n");
+4 -2
View File
@@ -1618,6 +1618,7 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)
struct rcu_segcblist *rsclp = &rdp->cblist;
bool waslocked;
bool wassleep;
unsigned long j;
if (rdp->nocb_gp_rdp == rdp)
show_rcu_nocb_gp_state(rdp);
@@ -1639,6 +1640,7 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)
rsclp->gp_seq[RCU_NEXT_READY_TAIL].exp);
sprintf(bufn, "%ld", rsclp->seglen[RCU_NEXT_TAIL]);
sprintf(bufb, "%ld", rcu_cblist_n_cbs(&rdp->nocb_bypass));
j = jiffies;
pr_info(" CB %d^%d->%d %c%c%c%c%c F%ld L%ld C%d %c%s%c%s%c%s%c%s%c%s q%ld %c CPU %d%s\n",
rdp->cpu, rdp->nocb_gp_rdp->cpu,
nocb_next_rdp ? nocb_next_rdp->cpu : -1,
@@ -1647,8 +1649,8 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)
"lL"[raw_spin_is_locked(&rdp->nocb_lock)],
"sS"[!!rdp->nocb_cb_sleep],
".W"[swait_active(&rdp->nocb_cb_wq)],
jiffies - rdp->nocb_bypass_first,
jiffies - rdp->nocb_nobypass_last,
j - rdp->nocb_bypass_first,
j - rdp->nocb_nobypass_last,
rdp->nocb_nobypass_count,
".D"[rcu_segcblist_ready_cbs(rsclp)],
rcu_segcblist_segempty(rsclp, RCU_DONE_TAIL) ? "" : bufd,