rcu: Make rcu_cpu_starting() rely on interrupts being disabled
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 27 Apr 2023 17:50:47 +0000 (10:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:01 +0000 (16:21 +0200)
commitd58f0f0ce6332ffeb406540295cc49732c26fb51
treed4dd488b8bb4deede5eca814406d3268b37321da
parent5d56a8d670a57402b244b8e70373a9fa6080f333
rcu: Make rcu_cpu_starting() rely on interrupts being disabled

[ Upstream commit 15d44dfa40305da1648de4bf001e91cc63148725 ]

Currently, rcu_cpu_starting() is written so that it might be invoked
with interrupts enabled.  However, it is always called when interrupts
are disabled, either by rcu_init(), notify_cpu_starting(), or from a
call point prior to the call to notify_cpu_starting().

But why bother requiring that interrupts be disabled?  The purpose is
to allow the rcu_data structure's ->beenonline flag to be set after all
early processing has completed for the incoming CPU, thus allowing this
flag to be used to determine when workqueues have been set up for the
incoming CPU, while still allowing this flag to be used as a diagnostic
within rcu_core().

This commit therefore makes rcu_cpu_starting() rely on interrupts being
disabled.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Stable-dep-of: 401b0de3ae4f ("rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/rcu/tree.c