mirror-linux/kernel/rcu
Paul E. McKenney 593889c401 srcu: Don't queue workqueue handlers to never-online CPUs
While an srcu_struct structure is in the midst of switching from CPU-0
to all-CPUs state, it can attempt to invoke callbacks for CPUs that
have never been online.  Worse yet, it can attempt in invoke callbacks
for CPUs that never will be online, even including imaginary CPUs not in
cpu_possible_mask.  This can cause hangs on s390, which is not set up to
deal with workqueue handlers being scheduled on such CPUs.  This commit
therefore causes Tree SRCU to refrain from queueing workqueue handlers
on CPUs that have not yet (and might never) come online.

Because callbacks are not invoked on CPUs that have not been
online, it is an error to invoke call_srcu(), synchronize_srcu(), or
synchronize_srcu_expedited() on a CPU that is not yet fully online.
However, it turns out to be less code to redirect the callbacks
from too-early invocations of call_srcu() than to warn about such
invocations.  This commit therefore also redirects callbacks queued on
not-yet-fully-online CPUs to the boot CPU.

Reported-by: Vasily Gorbik <gor@linux.ibm.com>
Fixes: 61bbcfb505 ("srcu: Push srcu_node allocation to GP when non-preemptible")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: Vasily Gorbik <gor@linux.ibm.com>
Tested-by: Samir <samir@linux.ibm.com>
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Boqun Feng <boqun@kernel.org>
2026-05-18 12:27:18 -07:00
..
Kconfig rcu: Add noinstr-fast rcu_read_{,un}lock_tasks_trace() APIs 2026-01-01 16:39:46 +08:00
Kconfig.debug RCU changes for v7.1 2026-04-13 09:36:45 -07:00
Makefile rcuperf: Change rcuperf to rcuscale 2020-08-24 18:39:24 -07:00
rcu.h rcutorture: Add a textbook-style trivial preemptible RCU 2026-03-30 15:48:13 -04:00
rcu_segcblist.c rcu/nocb: Simplify (de-)offloading state machine 2024-09-09 00:03:55 +05:30
rcu_segcblist.h rcu: Remove unused declaration rcu_segcblist_offload() 2024-10-22 15:36:56 +02:00
rcuscale.c rcuscale: Ditch rcu_scale_shutdown in favor of torture_shutdown_init() 2026-03-30 15:48:13 -04:00
rcutorture.c rcutorture: Test call_srcu() with preemption disabled and not 2026-03-30 15:48:14 -04:00
refscale.c refscale: Ditch ref_scale_shutdown in favor of torture_shutdown_init() 2026-03-30 15:48:13 -04:00
srcutiny.c srcu: Use irq_work to start GP in tiny SRCU 2026-03-25 09:00:05 -07:00
srcutree.c srcu: Don't queue workqueue handlers to never-online CPUs 2026-05-18 12:27:18 -07:00
sync.c rcu: Eliminate lockless accesses to rcu_sync->gp_count 2024-07-04 13:48:57 -07:00
tasks.h rcu-tasks: Remove unnecessary smp_store_release() in cblist_init_generic() 2026-03-30 15:48:14 -04:00
tiny.c sched: Provide and use set_need_resched_current() 2025-11-20 22:26:09 +01:00
tree.c Merge branch 'rcu-nocb.20260123a' 2026-01-23 11:15:36 -08:00
tree.h Merge branch 'rcu-nocb.20260123a' 2026-01-23 11:15:36 -08:00
tree_exp.h rcu: Make expedited RCU CPU stall warnings detect stall-end races 2026-01-07 21:58:26 +08:00
tree_nocb.h rcu/nocb: Extract nocb_bypass_needs_flush() to reduce duplication 2026-03-30 15:48:14 -04:00
tree_plugin.h rcu: Fix rcu_read_unlock() deadloop due to softirq 2026-01-07 21:58:37 +08:00
tree_stall.h rcu: Add BOOTPARAM_RCU_STALL_PANIC Kconfig option 2026-03-30 15:48:14 -04:00
update.c rcutorture: Add a textbook-style trivial preemptible RCU 2026-03-30 15:48:13 -04:00