]> asedeno.scripts.mit.edu Git - linux.git/commit
rcu: Stop expedited grace periods from relying on stop-machine
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 11 Sep 2018 15:57:48 +0000 (08:57 -0700)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Sun, 11 Nov 2018 19:23:01 +0000 (11:23 -0800)
commit9cac83a57e99e4692315b7a91a81bab787961d97
tree441acd0c2bbde270c183a383b7646804aa36fef5
parent651022382c7f8da46cb4872a545ee1da6d097d2a
rcu: Stop expedited grace periods from relying on stop-machine

The CPU-selection code in sync_rcu_exp_select_cpus() disables preemption
to prevent the cpu_online_mask from changing.  However, this relies on
the stop-machine mechanism in the CPU-hotplug offline code, which is not
desirable (it would be good to someday remove the stop-machine mechanism).

This commit therefore instead uses the relevant leaf rcu_node structure's
->ffmask, which has a bit set for all CPUs that are fully functional.
A given CPU's bit is cleared very early during offline processing by
rcutree_offline_cpu() and set very late during online processing by
rcutree_online_cpu().  Therefore, if a CPU's bit is set in this mask, and
preemption is disabled, we have to be before the synchronize_sched() in
the CPU-hotplug offline code, which means that the CPU is guaranteed to be
workqueue-ready throughout the duration of the enclosing preempt_disable()
region of code.

This also has the side-effect of using WORK_CPU_UNBOUND if all the CPUs for
this leaf rcu_node structure are offline, which is an acceptable difference
in behavior.

Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree_exp.h