Skip to content

Commit df68563

Browse files
committed
Merge tag 'rcu-fixes.v7.1-20260519a' of git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux
Pull RCU fixes from Boqun Feng: "Fix a regression introduced by commit 61bbcfb ("srcu: Push srcu_node allocation to GP when non-preemptible"). SRCU may queue works on CPUs that are "possible" but never have been online. In such a case, the work callbacks may not be executed until the corresponding CPU gets online, and as the callbacks accumulates, workqueue lockups will fire. Fix this by avoiding queuing works on CPUs that have never been online" * tag 'rcu-fixes.v7.1-20260519a' of git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux: srcu: Don't queue workqueue handlers to never-online CPUs
2 parents e312f53 + 593889c commit df68563

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

kernel/rcu/srcutree.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -897,11 +897,9 @@ static void srcu_schedule_cbs_snp(struct srcu_struct *ssp, struct srcu_node *snp
897897
{
898898
int cpu;
899899

900-
for (cpu = snp->grplo; cpu <= snp->grphi; cpu++) {
901-
if (!(mask & (1UL << (cpu - snp->grplo))))
902-
continue;
903-
srcu_schedule_cbs_sdp(per_cpu_ptr(ssp->sda, cpu), delay);
904-
}
900+
for (cpu = snp->grplo; cpu <= snp->grphi; cpu++)
901+
if ((mask & (1UL << (cpu - snp->grplo))) && rcu_cpu_beenfullyonline(cpu))
902+
srcu_schedule_cbs_sdp(per_cpu_ptr(ssp->sda, cpu), delay);
905903
}
906904

907905
/*
@@ -1322,7 +1320,9 @@ static unsigned long srcu_gp_start_if_needed(struct srcu_struct *ssp,
13221320
*/
13231321
idx = __srcu_read_lock_nmisafe(ssp);
13241322
ss_state = smp_load_acquire(&ssp->srcu_sup->srcu_size_state);
1325-
if (ss_state < SRCU_SIZE_WAIT_CALL)
1323+
// If !rcu_cpu_beenfullyonline(), interrupts are still disabled,
1324+
// so no migration is possible in either direction from this CPU.
1325+
if (ss_state < SRCU_SIZE_WAIT_CALL || !rcu_cpu_beenfullyonline(raw_smp_processor_id()))
13261326
sdp = per_cpu_ptr(ssp->sda, get_boot_cpu_id());
13271327
else
13281328
sdp = raw_cpu_ptr(ssp->sda);

0 commit comments

Comments
 (0)