summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorKunwu Chan <kunwu.chan@gmail.com>2026-09-07 15:58:26 +0800
committerPaul E. McKenney <paulmck@kernel.org>2026-10-12 16:50:39 -0700
commit41f899f18d0e1f00acd83b3f85ee3baa5da3d8fe (patch)
tree6d596bc29c4f866199ed6028954a7aa0f0d47341 /kernel
parent30d89cea5fa0118e4aec52511ab8210da4c363d9 (diff)
srcutree: Skip callback scheduling for atomic SRCU grace periods
call_srcu() is forbidden on atomic srcu_struct, so srcu_gp_end() never has callbacks to invoke for them. Yet it schedules callback invocation, which for atomic SRCU's SRCU_SIZE_SMALL state arms the boot CPU's ->delay_work timer every grace period, only for srcu_invoke_callbacks() to find nothing to do. Skip this for atomic SRCU. Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcu/srcutree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 93b8d1088abe..0954486880c7 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -1016,10 +1016,10 @@ static void srcu_gp_end(struct srcu_struct *ssp, bool is_atomic)
/* Initiate callback invocation as needed. */
ss_state = smp_load_acquire(&sup->srcu_size_state);
- if (ss_state < SRCU_SIZE_WAIT_BARRIER) {
+ if (!is_atomic && ss_state < SRCU_SIZE_WAIT_BARRIER) {
srcu_schedule_cbs_sdp(per_cpu_ptr(ssp->sda, get_boot_cpu_id()),
cbdelay);
- } else {
+ } else if (!is_atomic) {
idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs);
srcu_for_each_node_breadth_first(ssp, snp) {
raw_spin_lock_irq_rcu_node(snp);