]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rcu: Avoid tick_dep_set_cpu() misordering
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 27 Nov 2019 02:05:45 +0000 (18:05 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 24 Jan 2020 18:27:33 +0000 (10:27 -0800)
commit5b14557b073c96a7cf79adc4d7b6c4a8c26b2a43
tree4c4590af8b9c59b6408350d387c5aed3c4e76204
parent77339e61aa309310a535bd01eb3388f7a27b36f9
rcu: Avoid tick_dep_set_cpu() misordering

In the current code, rcu_nmi_enter_common() might decide to turn on
the tick using tick_dep_set_cpu(), but be delayed just before doing so.
Then the grace-period kthread might notice that the CPU in question had
in fact gone through a quiescent state, thus turning off the tick using
tick_dep_clear_cpu().  The later invocation of tick_dep_set_cpu() would
then incorrectly leave the tick on.

This commit therefore enlists the aid of the leaf rcu_node structure's
->lock to ensure that decisions to enable or disable the tick are
carried out before they can be reversed.

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