rcu-tasks: Update comments in call_rcu_tasks_generic()

This commit updates the comment "We can't create the thread unless
interrupts are enabled." from 'commit 4929c913bd ("rcu: Make
call_rcu_tasks() tolerate first call with irqs disabled")' to be more
clear and also to cover deferred wakeup and to take into account the fact
that kthread creation has been move to core_initcall() time by 'commit
c63eb17ff0 ("rcu: Create call_rcu_tasks() kthread at boot time")'.

Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
Zqiang 2026-07-13 18:31:26 +08:00 committed by Paul E. McKenney
parent a781301250
commit 5976694882

View File

@ -395,7 +395,11 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func,
raw_spin_unlock_irqrestore(&rtp->cbs_gbl_lock, flags);
}
rcu_read_unlock();
/* We can't create the thread unless interrupts are enabled. */
// We can't create the kthread with interrupts disabled because a
// scheduler spinlock might be held, so kthread creation is deferred
// until core_initcall() time. Similarly, wakeups are deferred using
// irq_work in order to avoid potential scheduler-lock-deadlock
// lockdep splats.
if (needwake && READ_ONCE(rtp->kthread_ptr))
irq_work_queue(&rtpcp->rtp_irq_work);
}