All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 05/47] cpuidle: Move CPUHP_AP_CPU_PM_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 07/47] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING " Frederic Weisbecker
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Rafael J. Wysocki, Christian Loehle,
	Daniel Lezcano, Lorenzo Pieralisi, Marco Crivellari,
	Peter Zijlstra, Phil Auld, Sudeep Holla, Thomas Gleixner,
	Ulf Hansson, Waiman Long, linux-arm-kernel, linux-pm,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here only touches local data and also the local
power device under its power lock. Therefore it should be safe to run
against other CPUs.

Move this teardown callback to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 58bb74f0fcb0..acc6a0e6446c 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_RCUTREE_DYING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_CPU_PM_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_RCUTREE_DYING);
+	WARN_ON(st->state != CPUHP_AP_CPU_PM_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 07/47] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
  2026-11-05 16:30 ` [PATCH 05/47] cpuidle: Move CPUHP_AP_CPU_PM_STARTING post stop_machine() Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 09/47] irqchip/loongarch-avec: Move CPUHP_AP_IRQ_AVECINTC_STARTING " Frederic Weisbecker
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Broadcom internal kernel review list,
	Florian Fainelli, Marco Crivellari, Peter Zijlstra, Phil Auld,
	Radu Rendec, Ray Jui, Scott Branden, Thomas Gleixner, Waiman Long,
	linux-arm-kernel, linux-rpi-kernel, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here just masks the per-cpu IRQ in the chip and
shouldn't race with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index cb0eb71c27c9..2e162425bfc7 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_IRQ_ARMADA_XP_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_IRQ_BCM2836_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_IRQ_ARMADA_XP_STARTING);
+	WARN_ON(st->state != CPUHP_AP_IRQ_BCM2836_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 09/47] irqchip/loongarch-avec: Move CPUHP_AP_IRQ_AVECINTC_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
  2026-11-05 16:30 ` [PATCH 05/47] cpuidle: Move CPUHP_AP_CPU_PM_STARTING post stop_machine() Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 07/47] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 10/47] irqchip/sifive-plic: Move CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING " Frederic Weisbecker
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Huacai Chen, Marco Crivellari,
	Peter Zijlstra, Phil Auld, Radu Rendec, Thomas Gleixner,
	WANG Xuerui, Waiman Long, loongarch, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

avecintc_cpu_offline() can run concurrently with other CPUs because
loongarch_avec.vector_matrix protects the internal structures.

Move this teardown callback to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index ac87ce01d77a..2200c6691ac1 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_IRQ_EIOINTC_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_IRQ_AVECINTC_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_IRQ_EIOINTC_STARTING);
+	WARN_ON(st->state != CPUHP_AP_IRQ_AVECINTC_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 10/47] irqchip/sifive-plic: Move CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (2 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 09/47] irqchip/loongarch-avec: Move CPUHP_AP_IRQ_AVECINTC_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 12/47] irqchip/irq-riscv-imsic-early: Move CPUHP_AP_IRQ_RISCV_IMSIC_STARTING " Frederic Weisbecker
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Marco Crivellari, Paul Walmsley,
	Peter Zijlstra, Phil Auld, Radu Rendec, Samuel Holland,
	Thomas Gleixner, Waiman Long, linux-riscv, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The callback here simply disables a per-cpu IRQ, which internally locks
the irq desc. Therefore it can run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 2200c6691ac1..c7794716bca6 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_IRQ_AVECINTC_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_IRQ_AVECINTC_STARTING);
+	WARN_ON(st->state != CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 12/47] irqchip/irq-riscv-imsic-early: Move CPUHP_AP_IRQ_RISCV_IMSIC_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (3 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 10/47] irqchip/sifive-plic: Move CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 14/47] perf/x86: Move CPUHP_AP_PERF_X86_STARTING " Frederic Weisbecker
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Albert Ou, Alexandre Ghiti, Anup Patel,
	Marco Crivellari, Palmer Dabbelt, Paul Walmsley, Peter Zijlstra,
	Phil Auld, Radu Rendec, Thomas Gleixner, Waiman Long, linux-riscv,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The callback here disables the current CPU IPI, which nobody should
touch concurrently since it is seen offline by other CPUs.

The sync protects internal datas with &lpriv->lock and the IRQ matrix
offline is protected by &imsic->matrix_lock. Therfore it can run
concurrently with other CPUs.

Move this teardown callback to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index c86570b13fed..151e4d9673b9 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_IRQ_ACLINT_SSWI_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_IRQ_RISCV_IMSIC_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_IRQ_ACLINT_SSWI_STARTING);
+	WARN_ON(st->state != CPUHP_AP_IRQ_RISCV_IMSIC_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 14/47] perf/x86: Move CPUHP_AP_PERF_X86_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (4 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 12/47] irqchip/irq-riscv-imsic-early: Move CPUHP_AP_IRQ_RISCV_IMSIC_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 18:22   ` sashiko-bot
  2026-11-05 16:30 ` [PATCH 15/47] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING " Frederic Weisbecker
                   ` (19 subsequent siblings)
  25 siblings, 1 reply; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, H. Peter Anvin, Adrian Hunter,
	Alexander Shishkin, Arnaldo Carvalho de Melo, Borislav Petkov,
	Dave Hansen, Ian Rogers, Ingo Molnar, James Clark, Jiri Olsa,
	Marco Crivellari, Mark Rutland, Namhyung Kim, Peter Zijlstra,
	Phil Auld, Thomas Gleixner, Waiman Long, linux-perf-users, x86,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

Here only intel has a dying callback (intel_pmu_cpu_dying()) which does:

* Deallocate the per CPU DS structure on the MSR_IA32_DS_AREA. This is
  already racy against offlining CPUs because all possible CPUs's MSR
  are written on a hardware event initialization, which still can happen
  before the CPU actually goes off.

* Deallocate PEBS buffer. This is already well synchronized against
  hotplug up callback.

Therefore the related teardwown callback can run concurrently with other
CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 2dd34a38f878..2aa2e9902a55 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_X86_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING);
+	WARN_ON(st->state != CPUHP_AP_PERF_X86_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 15/47] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (5 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 14/47] perf/x86: Move CPUHP_AP_PERF_X86_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 18:26   ` sashiko-bot
  2026-11-05 16:30 ` [PATCH 16/47] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING " Frederic Weisbecker
                   ` (18 subsequent siblings)
  25 siblings, 1 reply; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, H. Peter Anvin, Adrian Hunter,
	Alexander Shishkin, Arnaldo Carvalho de Melo, Borislav Petkov,
	Dave Hansen, Ian Rogers, Ingo Molnar, James Clark, Jiri Olsa,
	Marco Crivellari, Mark Rutland, Namhyung Kim, Peter Zijlstra,
	Phil Auld, Thomas Gleixner, Waiman Long, linux-perf-users, x86,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

Here the callback only restores the IBS interrupt to the normal priority
on the local APIC and running it concurrently against other CPUs
shouldn't expose any kind of race.

Move this teardown callback to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 2aa2e9902a55..678cb9efce05 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_X86_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_X86_AMD_IBS_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_PERF_X86_STARTING);
+	WARN_ON(st->state != CPUHP_AP_PERF_X86_AMD_IBS_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 16/47] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (6 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 15/47] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 18:29   ` sashiko-bot
  2026-11-05 16:30 ` [PATCH 17/47] ARM: vfp: Move CPUHP_AP_ARM_VFP_STARTING " Frederic Weisbecker
                   ` (17 subsequent siblings)
  25 siblings, 1 reply; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Adrian Hunter, Alexander Shishkin,
	Arnaldo Carvalho de Melo, Chris Zankel, Ian Rogers, Ingo Molnar,
	James Clark, Jiri Olsa, Marco Crivellari, Mark Rutland,
	Max Filippov, Namhyung Kim, Peter Zijlstra, Phil Auld,
	Thomas Gleixner, Waiman Long, linux-perf-users, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

This state doesn't have a teardown callback.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 678cb9efce05..a9c5b0c1974b 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_X86_AMD_IBS_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_XTENSA_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_PERF_X86_AMD_IBS_STARTING);
+	WARN_ON(st->state != CPUHP_AP_PERF_XTENSA_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 17/47] ARM: vfp: Move CPUHP_AP_ARM_VFP_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (7 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 16/47] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 19/47] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING " Frederic Weisbecker
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Marco Crivellari, Peter Zijlstra, Phil Auld,
	Russell King, Thomas Gleixner, Waiman Long, linux-arm-kernel,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here only removes the local VFP state which is
never accessed remotely. As such it can run concurrently with other
CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index a9c5b0c1974b..4952a53e028b 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_XTENSA_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_VFP_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_PERF_XTENSA_STARTING);
+	WARN_ON(st->state != CPUHP_AP_ARM_VFP_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 19/47] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (8 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 17/47] ARM: vfp: Move CPUHP_AP_ARM_VFP_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 18:40   ` sashiko-bot
  2026-11-05 16:30   ` Frederic Weisbecker
                   ` (15 subsequent siblings)
  25 siblings, 1 reply; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Marco Crivellari, Mark Rutland,
	Peter Zijlstra, Phil Auld, Thomas Gleixner, Waiman Long,
	Will Deacon, linux-arm-kernel, linux-perf-users, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here just disables the IRQs for each PMUs, which
shouldn't expose any specific race while other CPUs are running.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 37cca370794a..632103c9b4d9 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_ARM_ACPI_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_ARM_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_PERF_ARM_ACPI_STARTING);
+	WARN_ON(st->state != CPUHP_AP_PERF_ARM_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 20/47] perf: RISC-V: Move CPUHP_AP_PERF_RISCV_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
@ 2026-11-05 16:30   ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 07/47] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING " Frederic Weisbecker
                     ` (24 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Albert Ou, Alexandre Ghiti, Anup Patel,
	Atish Patra, Marco Crivellari, Mark Rutland, Palmer Dabbelt,
	Paul Walmsley, Peter Zijlstra, Phil Auld, Thomas Gleixner,
	Waiman Long, Will Deacon, linux-arm-kernel, linux-perf-users,
	linux-riscv, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here:

* Disables the per-cpu IRQ
* Disables user-mode access to the CPU counter
* Disables the shared memory snapshot of the CPU PMU.

All these operations are local to the CPU and should be able to execute
concurrently with other CPUs.

Move this teardown callback to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 632103c9b4d9..2ad19f3f2563 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_ARM_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_RISCV_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_PERF_ARM_STARTING);
+	WARN_ON(st->state != CPUHP_AP_PERF_RISCV_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 20/47] perf: RISC-V: Move CPUHP_AP_PERF_RISCV_STARTING post stop_machine()
@ 2026-11-05 16:30   ` Frederic Weisbecker
  0 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Albert Ou, Alexandre Ghiti, Anup Patel,
	Atish Patra, Marco Crivellari, Mark Rutland, Palmer Dabbelt,
	Paul Walmsley, Peter Zijlstra, Phil Auld, Thomas Gleixner,
	Waiman Long, Will Deacon, linux-arm-kernel, linux-perf-users,
	linux-riscv, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here:

* Disables the per-cpu IRQ
* Disables user-mode access to the CPU counter
* Disables the shared memory snapshot of the CPU PMU.

All these operations are local to the CPU and should be able to execute
concurrently with other CPUs.

Move this teardown callback to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 632103c9b4d9..2ad19f3f2563 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_ARM_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_RISCV_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_PERF_ARM_STARTING);
+	WARN_ON(st->state != CPUHP_AP_PERF_RISCV_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 21/47] ARM: l2c: Move CPUHP_AP_ARM_L2X0_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (10 preceding siblings ...)
  2026-11-05 16:30   ` Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 22/47] clocksource/drivers/exynos_mct: Move CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING " Frederic Weisbecker
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Marco Crivellari, Peter Zijlstra, Phil Auld,
	Russell King, Thomas Gleixner, Waiman Long, linux-arm-kernel,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here disables the L1/L2 cache prefetch and the
write full line of zeros mode. These operations should only impact the
outgoing CPU and can run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 2ad19f3f2563..498ff31b24cf 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_PERF_RISCV_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_L2X0_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_PERF_RISCV_STARTING);
+	WARN_ON(st->state != CPUHP_AP_ARM_L2X0_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 22/47] clocksource/drivers/exynos_mct: Move CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (11 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 21/47] ARM: l2c: Move CPUHP_AP_ARM_L2X0_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 23/47] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_STARTING " Frederic Weisbecker
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Alim Akhtar, Daniel Lezcano,
	Krzysztof Kozlowski, Marco Crivellari, Peter Griffin,
	Peter Zijlstra, Phil Auld, Thomas Gleixner, Waiman Long,
	linux-arm-kernel, linux-samsung-soc, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply disables the IRQ and clears/ack the
interrupt bit on the local device. All these operations can run
concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 498ff31b24cf..a4db04807aa7 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_L2X0_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_ARM_L2X0_STARTING);
+	WARN_ON(st->state != CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 23/47] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (12 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 22/47] clocksource/drivers/exynos_mct: Move CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 24/47] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING " Frederic Weisbecker
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Daniel Lezcano, Marc Zyngier,
	Marco Crivellari, Mark Rutland, Peter Zijlstra, Phil Auld,
	Thomas Gleixner, Waiman Long, linux-arm-kernel, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs IRQs disablement, which can run
concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index a4db04807aa7..3c561a630962 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_ARCH_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_ARM_ARCH_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 24/47] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (13 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 23/47] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 25/47] clocksource/drivers/arm_global_timer: Move CPUHP_AP_ARM_GLOBAL_TIMER_STARTING " Frederic Weisbecker
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Daniel Lezcano, Marc Zyngier,
	Marco Crivellari, Mark Rutland, Peter Zijlstra, Phil Auld,
	Thomas Gleixner, Waiman Long, linux-arm-kernel, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here only clears the CPU from the
evtstrm_available cpumask, which is only ever checked locally for the
current CPU. And set/clear from other CPUs are atomic.

Therefore this callback is safe to run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 3c561a630962..6f4c609163e5 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_ARCH_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_ARM_ARCH_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 25/47] clocksource/drivers/arm_global_timer: Move CPUHP_AP_ARM_GLOBAL_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (14 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 24/47] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 27/47] ARM: smp_twd: Move CPUHP_AP_ARM_TWD_STARTING " Frederic Weisbecker
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Daniel Lezcano, Marco Crivellari,
	Patrice Chotard, Peter Zijlstra, Phil Auld, Thomas Gleixner,
	Waiman Long, linux-arm-kernel, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs IRQ disablement, which can
run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 6f4c609163e5..d980d11abf27 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_GLOBAL_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING);
+	WARN_ON(st->state != CPUHP_AP_ARM_GLOBAL_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 27/47] ARM: smp_twd: Move CPUHP_AP_ARM_TWD_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (15 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 25/47] clocksource/drivers/arm_global_timer: Move CPUHP_AP_ARM_GLOBAL_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 29/47] clocksource/drivers/timer-tegra: Move CPUHP_AP_TEGRA_TIMER_STARTING " Frederic Weisbecker
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Marco Crivellari, Peter Zijlstra, Phil Auld,
	Russell King, Thomas Gleixner, Waiman Long, linux-arm-kernel,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs IRQ disablement, which can
run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 38d60ddc166a..d7a6dcb14885 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_JCORE_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_TWD_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_JCORE_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_ARM_TWD_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 29/47] clocksource/drivers/timer-tegra: Move CPUHP_AP_TEGRA_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (16 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 27/47] ARM: smp_twd: Move CPUHP_AP_ARM_TWD_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 31/47] LoongArch: Move CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING " Frederic Weisbecker
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Daniel Lezcano, Jonathan Hunter,
	Marco Crivellari, Peter Zijlstra, Phil Auld, Thierry Reding,
	Thomas Gleixner, Waiman Long, linux-tegra, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs IRQ disablement, which can
run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index fc29c33a03e1..27acdd9800cf 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_QCOM_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_TEGRA_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_QCOM_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_TEGRA_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 31/47] LoongArch: Move CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (17 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 29/47] clocksource/drivers/timer-tegra: Move CPUHP_AP_TEGRA_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 32/47] clocksource/drivers/mips-gic-timer: Move CPUHP_AP_MIPS_GIC_TIMER_STARTING " Frederic Weisbecker
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Thomas Weißschuh, Arnd Bergmann,
	Huacai Chen, Jiaxun Yang, Marco Crivellari, Peter Zijlstra,
	Phil Auld, Thomas Gleixner, WANG Xuerui, Waiman Long, loongarch,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply clears the interrupt on the CSR,
operation that can run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 8a563de99dc1..9a3936cd6d79 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARMADA_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_ARMADA_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 32/47] clocksource/drivers/mips-gic-timer: Move CPUHP_AP_MIPS_GIC_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (18 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 31/47] LoongArch: Move CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 33/47] clocksource/drivers/arc_timer: Move CPUHP_AP_ARC_TIMER_STARTING " Frederic Weisbecker
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Daniel Lezcano, Marco Crivellari,
	Peter Zijlstra, Phil Auld, Thomas Bogendoerfer, Thomas Gleixner,
	Waiman Long, linux-mips, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs IRQ disablement, which can
run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 9a3936cd6d79..4451c5997cc6 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_MIPS_GIC_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_MIPS_GIC_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 33/47] clocksource/drivers/arc_timer: Move CPUHP_AP_ARC_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (19 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 32/47] clocksource/drivers/mips-gic-timer: Move CPUHP_AP_MIPS_GIC_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 35/47] clocksource/drivers/timer-riscv: Move CPUHP_AP_RISCV_TIMER_STARTING " Frederic Weisbecker
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Daniel Lezcano, Marco Crivellari,
	Peter Zijlstra, Phil Auld, Thomas Gleixner, Vineet Gupta,
	Waiman Long, linux-snps-arc, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs IRQ disablement, which can
run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 4451c5997cc6..3fb757c6bc7f 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_MIPS_GIC_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARC_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_MIPS_GIC_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_ARC_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 35/47] clocksource/drivers/timer-riscv: Move CPUHP_AP_RISCV_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (20 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 33/47] clocksource/drivers/arc_timer: Move CPUHP_AP_ARC_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 37/47] clocksource/drivers/c-sky: Move CPUHP_AP_CSKY_TIMER_STARTING " Frederic Weisbecker
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Albert Ou, Alexandre Ghiti, Daniel Lezcano,
	Marco Crivellari, Palmer Dabbelt, Paul Walmsley, Peter Zijlstra,
	Phil Auld, Thomas Gleixner, Waiman Long, linux-riscv,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs timer and IRQ disablement,
both of which can run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 9b2e5862252e..04692ae09199 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_REALTEK_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_RISCV_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_REALTEK_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_RISCV_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 37/47] clocksource/drivers/c-sky: Move CPUHP_AP_CSKY_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (21 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 35/47] clocksource/drivers/timer-riscv: Move CPUHP_AP_RISCV_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 39/47] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING " Frederic Weisbecker
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Daniel Lezcano, Guo Ren, Marco Crivellari,
	Peter Zijlstra, Phil Auld, Thomas Gleixner, Waiman Long,
	linux-csky, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs IRQ disablement, which can
run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 01c343b4daea..44f425cc48d9 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_CLINT_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_CSKY_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_CLINT_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_CSKY_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 39/47] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (22 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 37/47] clocksource/drivers/c-sky: Move CPUHP_AP_CSKY_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-06 10:07   ` Naman Jain
  2026-11-05 16:30 ` [PATCH 41/47] ARM: xen: Move CPUHP_AP_ARM_XEN_STARTING " Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 47/47] ARM: mm: Move CPUHP_AP_ARM_CACHE_B15_RAC_DYING " Frederic Weisbecker
  25 siblings, 1 reply; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, K. Y. Srinivasan, Daniel Lezcano, Dexuan Cui,
	Haiyang Zhang, Long Li, Marco Crivellari, Peter Zijlstra,
	Phil Auld, Thomas Gleixner, Waiman Long, Wei Liu, linux-hyperv,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs timer and IRQ disablement,
both of which can run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 93b8498e26c4..b49b67ef5ecb 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_TI_GP_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_HYPERV_TIMER_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_TI_GP_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_HYPERV_TIMER_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 41/47] ARM: xen: Move CPUHP_AP_ARM_XEN_STARTING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (23 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 39/47] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  2026-11-05 16:30 ` [PATCH 47/47] ARM: mm: Move CPUHP_AP_ARM_CACHE_B15_RAC_DYING " Frederic Weisbecker
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Marco Crivellari, Peter Zijlstra, Phil Auld,
	Russell King, Stefano Stabellini, Thomas Gleixner, Waiman Long,
	linux-arm-kernel, xen-devel, Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The teardown callback here simply performs IRQ disablement, which can
run concurrently with other CPUs.

Move it to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 47b33c6759aa..5c84a39f6f06 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_DUMMY_TIMER_STARTING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ARM_XEN_STARTING);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_DUMMY_TIMER_STARTING);
+	WARN_ON(st->state != CPUHP_AP_ARM_XEN_STARTING);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 47/47] ARM: mm: Move CPUHP_AP_ARM_CACHE_B15_RAC_DYING post stop_machine()
       [not found] <20261105163045.38862-1-frederic@kernel.org>
                   ` (24 preceding siblings ...)
  2026-11-05 16:30 ` [PATCH 41/47] ARM: xen: Move CPUHP_AP_ARM_XEN_STARTING " Frederic Weisbecker
@ 2026-11-05 16:30 ` Frederic Weisbecker
  25 siblings, 0 replies; 33+ messages in thread
From: Frederic Weisbecker @ 2026-11-05 16:30 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Broadcom internal kernel review list,
	Florian Fainelli, Marco Crivellari, Peter Zijlstra, Phil Auld,
	Russell King, Thomas Gleixner, Waiman Long, linux-arm-kernel,
	Paul E. McKenney

Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
all the teardown callbacks while stopping all CPUs in the system. This
doesn't mix-up well with running RT or isolated tasks.

In order to transition smoothly from global stop_machine to finer
grained synchronization between teardown callbacks and the other CPUs,
a new stop machine post function has been introduced to be executed
after the main one with IRQs still disabled while other CPUs can exit
stop_machine().

The cache readahead can be globally disabled while the other CPUs are
running.

Move this teardown callback to post stop_machine() accordingly.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 995b235da733..b6d7a8e70fe5 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
 static int take_cpu_down(void *_param)
 {
 	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
-	enum cpuhp_state target = max((int)st->target, CPUHP_AP_X86_TBOOT_DYING);
+	enum cpuhp_state target = max((int)st->target, CPUHP_AP_ONLINE);
 	int err, cpu = smp_processor_id();
 
 	/* Ensure this CPU doesn't handle any more interrupts. */
@@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
 	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
 	int cpu = smp_processor_id();
 
-	WARN_ON(st->state != CPUHP_AP_X86_TBOOT_DYING);
+	WARN_ON(st->state != CPUHP_AP_ONLINE);
 	/*
 	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
 	 */
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 33+ messages in thread

* Re: [PATCH 14/47] perf/x86: Move CPUHP_AP_PERF_X86_STARTING post stop_machine()
  2026-11-05 16:30 ` [PATCH 14/47] perf/x86: Move CPUHP_AP_PERF_X86_STARTING " Frederic Weisbecker
@ 2026-11-05 18:22   ` sashiko-bot
  0 siblings, 0 replies; 33+ messages in thread
From: sashiko-bot @ 2026-11-05 18:22 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: linux-perf-users

> Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
> all the teardown callbacks while stopping all CPUs in the system. This
> doesn't mix-up well with running RT or isolated tasks.
> 
> In order to transition smoothly from global stop_machine to finer
> grained synchronization between teardown callbacks and the other CPUs,
> a new stop machine post function has been introduced to be executed
> after the main one with IRQs still disabled while other CPUs can exit
> stop_machine().
> 
> Here only intel has a dying callback (intel_pmu_cpu_dying()) which does:
> 
> * Deallocate the per CPU DS structure on the MSR_IA32_DS_AREA. This is
>   already racy against offlining CPUs because all possible CPUs's MSR
>   are written on a hardware event initialization, which still can happen
>   before the CPU actually goes off.
> 
> * Deallocate PEBS buffer. This is already well synchronized against
>   hotplug up callback.
> 
> Therefore the related teardwown callback can run concurrently with other
> CPUs.
> 
> Move it to post stop_machine() accordingly.
> 
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105163045.38862-1-frederic@kernel.org?part=14


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 15/47] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING post stop_machine()
  2026-11-05 16:30 ` [PATCH 15/47] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING " Frederic Weisbecker
@ 2026-11-05 18:26   ` sashiko-bot
  0 siblings, 0 replies; 33+ messages in thread
From: sashiko-bot @ 2026-11-05 18:26 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: linux-perf-users

> Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
> all the teardown callbacks while stopping all CPUs in the system. This
> doesn't mix-up well with running RT or isolated tasks.
> 
> In order to transition smoothly from global stop_machine to finer
> grained synchronization between teardown callbacks and the other CPUs,
> a new stop machine post function has been introduced to be executed
> after the main one with IRQs still disabled while other CPUs can exit
> stop_machine().
> 
> Here the callback only restores the IBS interrupt to the normal priority
> on the local APIC and running it concurrently against other CPUs
> shouldn't expose any kind of race.
> 
> Move this teardown callback to post stop_machine() accordingly.
> 
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105163045.38862-1-frederic@kernel.org?part=15


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 16/47] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING post stop_machine()
  2026-11-05 16:30 ` [PATCH 16/47] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING " Frederic Weisbecker
@ 2026-11-05 18:29   ` sashiko-bot
  0 siblings, 0 replies; 33+ messages in thread
From: sashiko-bot @ 2026-11-05 18:29 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: linux-perf-users

> Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
> all the teardown callbacks while stopping all CPUs in the system. This
> doesn't mix-up well with running RT or isolated tasks.
> 
> In order to transition smoothly from global stop_machine to finer
> grained synchronization between teardown callbacks and the other CPUs,
> a new stop machine post function has been introduced to be executed
> after the main one with IRQs still disabled while other CPUs can exit
> stop_machine().
> 
> This state doesn't have a teardown callback.
> 
> Move it to post stop_machine() accordingly.
> 
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105163045.38862-1-frederic@kernel.org?part=16


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 19/47] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING post stop_machine()
  2026-11-05 16:30 ` [PATCH 19/47] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING " Frederic Weisbecker
@ 2026-11-05 18:40   ` sashiko-bot
  0 siblings, 0 replies; 33+ messages in thread
From: sashiko-bot @ 2026-11-05 18:40 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: linux-perf-users

> Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
> all the teardown callbacks while stopping all CPUs in the system. This
> doesn't mix-up well with running RT or isolated tasks.
> 
> In order to transition smoothly from global stop_machine to finer
> grained synchronization between teardown callbacks and the other CPUs,
> a new stop machine post function has been introduced to be executed
> after the main one with IRQs still disabled while other CPUs can exit
> stop_machine().
> 
> The teardown callback here just disables the IRQs for each PMUs, which
> shouldn't expose any specific race while other CPUs are running.
> 
> Move it to post stop_machine() accordingly.
> 
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105163045.38862-1-frederic@kernel.org?part=19


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 20/47] perf: RISC-V: Move CPUHP_AP_PERF_RISCV_STARTING post stop_machine()
  2026-11-05 16:30   ` Frederic Weisbecker
  (?)
@ 2026-11-05 18:42   ` sashiko-bot
  -1 siblings, 0 replies; 33+ messages in thread
From: sashiko-bot @ 2026-11-05 18:42 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: linux-perf-users

> Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
> all the teardown callbacks while stopping all CPUs in the system. This
> doesn't mix-up well with running RT or isolated tasks.
> 
> In order to transition smoothly from global stop_machine to finer
> grained synchronization between teardown callbacks and the other CPUs,
> a new stop machine post function has been introduced to be executed
> after the main one with IRQs still disabled while other CPUs can exit
> stop_machine().
> 
> The teardown callback here:
> 
> * Disables the per-cpu IRQ
> * Disables user-mode access to the CPU counter
> * Disables the shared memory snapshot of the CPU PMU.
> 
> All these operations are local to the CPU and should be able to execute
> concurrently with other CPUs.
> 
> Move this teardown callback to post stop_machine() accordingly.
> 
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105163045.38862-1-frederic@kernel.org?part=20


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 39/47] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING post stop_machine()
  2026-11-05 16:30 ` [PATCH 39/47] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING " Frederic Weisbecker
@ 2026-11-06 10:07   ` Naman Jain
  0 siblings, 0 replies; 33+ messages in thread
From: Naman Jain @ 2026-11-06 10:07 UTC (permalink / raw)
  To: Frederic Weisbecker, LKML
  Cc: K. Y. Srinivasan, Daniel Lezcano, Dexuan Cui, Haiyang Zhang,
	Long Li, Marco Crivellari, Peter Zijlstra, Phil Auld,
	Thomas Gleixner, Waiman Long, Wei Liu, linux-hyperv,
	Paul E. McKenney



On 11/5/2026 10:00 PM, Frederic Weisbecker wrote:
> Between CPUHP_TEARDOWN_CPU and CPUHP_AP_OFFLINE, stop_machine executes
> all the teardown callbacks while stopping all CPUs in the system. This
> doesn't mix-up well with running RT or isolated tasks.
> 
> In order to transition smoothly from global stop_machine to finer
> grained synchronization between teardown callbacks and the other CPUs,
> a new stop machine post function has been introduced to be executed
> after the main one with IRQs still disabled while other CPUs can exit
> stop_machine().
> 
> The teardown callback here simply performs timer and IRQ disablement,
> both of which can run concurrently with other CPUs.
> 
> Move it to post stop_machine() accordingly.
> 
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> ---
>   kernel/cpu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 93b8498e26c4..b49b67ef5ecb 100644

I am unable to correlate the commit message with the change and could 
not find the rest of the series on lore to get more context.


Regards,
Naman

> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -1275,7 +1275,7 @@ void clear_tasks_mm_cpumask(int cpu)
>   static int take_cpu_down(void *_param)
>   {
>   	struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
> -	enum cpuhp_state target = max((int)st->target, CPUHP_AP_TI_GP_TIMER_STARTING);
> +	enum cpuhp_state target = max((int)st->target, CPUHP_AP_HYPERV_TIMER_STARTING);
>   	int err, cpu = smp_processor_id();
>   
>   	/* Ensure this CPU doesn't handle any more interrupts. */
> @@ -1303,7 +1303,7 @@ static int take_cpu_down_post(void *_param)
>   	enum cpuhp_state target = max((int)st->target, CPUHP_AP_OFFLINE);
>   	int cpu = smp_processor_id();
>   
> -	WARN_ON(st->state != CPUHP_AP_TI_GP_TIMER_STARTING);
> +	WARN_ON(st->state != CPUHP_AP_HYPERV_TIMER_STARTING);
>   	/*
>   	 * Invoke the former CPU_DYING callbacks. DYING must not fail!
>   	 */


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2026-11-06 10:07 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261105163045.38862-1-frederic@kernel.org>
2026-11-05 16:30 ` [PATCH 05/47] cpuidle: Move CPUHP_AP_CPU_PM_STARTING post stop_machine() Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 07/47] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 09/47] irqchip/loongarch-avec: Move CPUHP_AP_IRQ_AVECINTC_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 10/47] irqchip/sifive-plic: Move CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 12/47] irqchip/irq-riscv-imsic-early: Move CPUHP_AP_IRQ_RISCV_IMSIC_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 14/47] perf/x86: Move CPUHP_AP_PERF_X86_STARTING " Frederic Weisbecker
2026-11-05 18:22   ` sashiko-bot
2026-11-05 16:30 ` [PATCH 15/47] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING " Frederic Weisbecker
2026-11-05 18:26   ` sashiko-bot
2026-11-05 16:30 ` [PATCH 16/47] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING " Frederic Weisbecker
2026-11-05 18:29   ` sashiko-bot
2026-11-05 16:30 ` [PATCH 17/47] ARM: vfp: Move CPUHP_AP_ARM_VFP_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 19/47] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING " Frederic Weisbecker
2026-11-05 18:40   ` sashiko-bot
2026-11-05 16:30 ` [PATCH 20/47] perf: RISC-V: Move CPUHP_AP_PERF_RISCV_STARTING " Frederic Weisbecker
2026-11-05 16:30   ` Frederic Weisbecker
2026-11-05 18:42   ` sashiko-bot
2026-11-05 16:30 ` [PATCH 21/47] ARM: l2c: Move CPUHP_AP_ARM_L2X0_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 22/47] clocksource/drivers/exynos_mct: Move CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 23/47] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 24/47] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 25/47] clocksource/drivers/arm_global_timer: Move CPUHP_AP_ARM_GLOBAL_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 27/47] ARM: smp_twd: Move CPUHP_AP_ARM_TWD_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 29/47] clocksource/drivers/timer-tegra: Move CPUHP_AP_TEGRA_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 31/47] LoongArch: Move CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 32/47] clocksource/drivers/mips-gic-timer: Move CPUHP_AP_MIPS_GIC_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 33/47] clocksource/drivers/arc_timer: Move CPUHP_AP_ARC_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 35/47] clocksource/drivers/timer-riscv: Move CPUHP_AP_RISCV_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 37/47] clocksource/drivers/c-sky: Move CPUHP_AP_CSKY_TIMER_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 39/47] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING " Frederic Weisbecker
2026-11-06 10:07   ` Naman Jain
2026-11-05 16:30 ` [PATCH 41/47] ARM: xen: Move CPUHP_AP_ARM_XEN_STARTING " Frederic Weisbecker
2026-11-05 16:30 ` [PATCH 47/47] ARM: mm: Move CPUHP_AP_ARM_CACHE_B15_RAC_DYING " Frederic Weisbecker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.