]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smp: Document preemption and stop_machine() mutual exclusion
authorJoel Fernandes <joelagnelf@nvidia.com>
Tue, 15 Jul 2025 20:01:51 +0000 (16:01 -0400)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 17 Jul 2025 19:11:13 +0000 (12:11 -0700)
commitcf4fc66746e344181f41604066659073dbb8aaf0
tree6a30070c53af23fac7042f45a8839e3716ee18d3
parentfc6f89dc707838564abbb8e22dad8e4d75c7fa26
smp: Document preemption and stop_machine() mutual exclusion

Recently while revising RCU's cpu online checks, there was some discussion
around how IPIs synchronize with hotplug.

Add comments explaining how preemption disable creates mutual exclusion with
CPU hotplug's stop_machine mechanism. The key insight is that stop_machine()
atomically updates CPU masks and flushes IPIs with interrupts disabled, and
cannot proceed while any CPU (including the IPI sender) has preemption
disabled.

[ Apply peterz feedback. ]

Cc: Andrea Righi <arighi@nvidia.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: rcu@vger.kernel.org
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Co-developed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/smp.c