]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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>
Tue, 11 Jul 2023 17:39:25 +0000 (19:39 +0200)
commita1a3bbd825c7242f704447c4117a87c9c238c7da
treec5566bf0237b7e5343ca17a81d8d0bd76ffec9bc
parent5aa45866422da7f0fef9cb4eb35d9087304b7451
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