Skip to contentSkip to conversation

cpu: Remove obsolete comment from takedown_cpu()

PATCH Applied Waiman Long 2 participants 2 messages Jul 29, 2025 – Aug 11, 2025 CPU hotplug

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpu: Remove obsolete comment from takedown_cpu()

takedown_cpu() has a comment about "all preempt/rcu users must observe !cpu_active()" which is kind of meaningless in this function. This comment was originally introduced by commit 6acce3ef8452 ("sched: Remove get_online_cpus() usage") when _cpu_down() was setting cpu_active_mask and synchronize_rcu()/synchronize_sched() were added after that.

Later commit 40190a78f85f ("sched/hotplug: Convert cpu_[in]active notifiers to state machine") added a new CPUHP_AP_ACTIVE hotplug state to set/clear cpu_active_mask. The following commit b2454caa8977 ("sched/hotplug: Move sync_rcu to be with set_cpu_active(false)") move the synchronize_*() calls to sched_cpu_deactivate() associated with the new hotplug state, but left the comment behind.

Remove this comment as it is no longer relevant in takedown_cpu().

---
 kernel/cpu.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/cpu.c +0 -3
index a59e009e0be4..2addcba38c1a 100644
@@ -1308,9 +1308,6 @@ static int takedown_cpu(unsigned int cpu)
 	 */
 	irq_lock_sparse();
 
-	/*
-	 * So now all preempt/rcu users must observe !cpu_active().
-	 */
 	err = stop_machine_cpuslocked(take_cpu_down, NULL, cpumask_of(cpu));
 	if (err) {
 		/* CPU refused to die */
Signature · 1 line
2.50.0
merge bot Applied
#1 lore raw
The following commit has been merged into the smp/urgent branch of tip:

The following commit has been merged into the smp/urgent branch of tip:

Commit-ID:     da274853fe7dbc7124e2dd84dad802be52a09321
Gitweb:        https://git.kernel.org/tip/da274853fe7dbc7124e2dd84dad802be52a09321
Author:        Waiman Long <[email protected]>
AuthorDate:    Tue, 29 Jul 2025 15:12:32 -04:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Wed, 06 Aug 2025 22:48:12 +02:00

cpu: Remove obsolete comment from takedown_cpu()

takedown_cpu() has a comment about "all preempt/rcu users must observe !cpu_active()" which is kind of meaningless in this function. This comment was originally introduced by commit 6acce3ef8452 ("sched: Remove get_online_cpus() usage") when _cpu_down() was setting cpu_active_mask and synchronize_rcu()/synchronize_sched() were added after that.

Later commit 40190a78f85f ("sched/hotplug: Convert cpu_[in]active notifiers to state machine") added a new CPUHP_AP_ACTIVE hotplug state to set/clear cpu_active_mask. The following commit b2454caa8977 ("sched/hotplug: Move sync_rcu to be with set_cpu_active(false)") move the synchronize_*() calls to sched_cpu_deactivate() associated with the new hotplug state, but left the comment behind.

Remove this comment as it is no longer relevant in takedown_cpu().

---
 kernel/cpu.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/cpu.c +0 -3
index faf0f23..db9f6c5 100644
@@ -1309,9 +1309,6 @@ static int takedown_cpu(unsigned int cpu)
 	 */
 	irq_lock_sparse();
 
-	/*
-	 * So now all preempt/rcu users must observe !cpu_active().
-	 */
 	err = stop_machine_cpuslocked(take_cpu_down, NULL, cpumask_of(cpu));
 	if (err) {
 		/* CPU refused to die */