]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rcu: Invoke rcu_spawn_core_kthreads() from rcu_spawn_gp_kthread()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 31 Mar 2021 17:59:05 +0000 (10:59 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 6 Apr 2021 23:10:34 +0000 (16:10 -0700)
commitb61449a0d773d9cf99566a5c2739507befe07d23
tree116337f7e4ab1345ed42f4f7220c643a07e26b74
parentf6e694d2a7a8a8c44bfd50f788e54e49eb964131
rcu: Invoke rcu_spawn_core_kthreads() from rcu_spawn_gp_kthread()

Currently, rcu_spawn_core_kthreads() is invoked via an early_initcall(),
which works, except that rcu_spawn_gp_kthread() is also invoked via an
early_initcall() and rcu_spawn_core_kthreads() relies on adjustments to
kthread_prio that are carried out by rcu_spawn_gp_kthread().  There is
no guaranttee of ordering among early_initcall() handlers, and thus no
guarantee that kthread_prio will be properly checked and range-limited
at the time that rcu_spawn_core_kthreads() needs it.

In most cases, this bug is harmless.  After all, the only reason that
rcu_spawn_gp_kthread() adjusts the value of kthread_prio is if the user
specified a nonsensical value for this boot parameter, which experience
indicates is rare.

Nevertheless, a bug is a bug.  This commit therefore causes the
rcu_spawn_core_kthreads() function to be invoked directly from
rcu_spawn_gp_kthread() after any needed adjustments to kthread_prio have
been carried out.

Fixes: 48d07c04b4cc ("rcu: Enable elimination of Tree-RCU softirq processing")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c