* [PATCH] cpu: Remove obsolete comment from takedown_cpu()
@ 2025-07-29 19:12 Waiman Long
2025-08-06 20:59 ` [tip: smp/urgent] " tip-bot2 for Waiman Long
0 siblings, 1 reply; 2+ messages in thread
From: Waiman Long @ 2025-07-29 19:12 UTC (permalink / raw)
To: Thomas Gleixner, Peter Zijlstra; +Cc: linux-kernel, Waiman Long
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().
Signed-off-by: Waiman Long <longman@redhat.com>
---
kernel/cpu.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index a59e009e0be4..2addcba38c1a 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -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 */
--
2.50.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip: smp/urgent] cpu: Remove obsolete comment from takedown_cpu()
2025-07-29 19:12 [PATCH] cpu: Remove obsolete comment from takedown_cpu() Waiman Long
@ 2025-08-06 20:59 ` tip-bot2 for Waiman Long
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Waiman Long @ 2025-08-06 20:59 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Waiman Long, Thomas Gleixner, x86, linux-kernel
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 <longman@redhat.com>
AuthorDate: Tue, 29 Jul 2025 15:12:32 -04:00
Committer: Thomas Gleixner <tglx@linutronix.de>
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().
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250729191232.664931-1-longman@redhat.com
---
kernel/cpu.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index faf0f23..db9f6c5 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -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 */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-11 17:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-29 19:12 [PATCH] cpu: Remove obsolete comment from takedown_cpu() Waiman Long
2025-08-06 20:59 ` [tip: smp/urgent] " tip-bot2 for Waiman Long
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®