rcu: Exclude outgoing CPU when it is the last to leave
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 24 Aug 2022 21:46:56 +0000 (14:46 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 31 Aug 2022 12:06:03 +0000 (05:06 -0700)
commit7634b1eaa0cd135d5eedadb04ad3c91b1ecf28a9
treefde85933364145edccb84ddbd9dfed6a11bc5919
parent621189a1fe93cb2b34d62c5cdb9e258bca044813
rcu: Exclude outgoing CPU when it is the last to leave

The rcu_boost_kthread_setaffinity() function removes the outgoing CPU
from the set_cpus_allowed() mask for the corresponding leaf rcu_node
structure's rcub priority-boosting kthread.  Except that if the outgoing
CPU will leave that structure without any online CPUs, the mask is set
to the housekeeping CPU mask from housekeeping_cpumask().  Which is fine
unless the outgoing CPU happens to be a housekeeping CPU.

This commit therefore removes the outgoing CPU from the housekeeping mask.
This would of course be problematic if the outgoing CPU was the last
online housekeeping CPU, but in that case you are in a world of hurt
anyway.  If someone comes up with a valid use case for a system needing
all the housekeeping CPUs to be offline, further adjustments can be made.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_plugin.h