* [RFC PATCH 05/49] cpuidle: Move CPUHP_AP_CPU_PM_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 07/49] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING " Frederic Weisbecker
` (24 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 f22afb213d6f..68eb8de820d5 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] 32+ messages in thread* [RFC PATCH 07/49] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
2026-10-19 13:08 ` [RFC PATCH 05/49] cpuidle: Move CPUHP_AP_CPU_PM_STARTING post stop_machine() Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 09/49] irqchip/loongarch-avec: Move CPUHP_AP_IRQ_AVECINTC_STARTING " Frederic Weisbecker
` (23 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 293dbb73d940..db73cdfbf1d0 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] 32+ messages in thread* [RFC PATCH 09/49] irqchip/loongarch-avec: Move CPUHP_AP_IRQ_AVECINTC_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
2026-10-19 13:08 ` [RFC PATCH 05/49] cpuidle: Move CPUHP_AP_CPU_PM_STARTING post stop_machine() Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 07/49] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 10/49] irqchip/sifive-plic: Move CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING " Frederic Weisbecker
` (22 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 126896b2c970..f32404821731 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] 32+ messages in thread* [RFC PATCH 10/49] irqchip/sifive-plic: Move CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (2 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 09/49] irqchip/loongarch-avec: Move CPUHP_AP_IRQ_AVECINTC_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 12/49] irqchip/irq-riscv-imsic-early: Move CPUHP_AP_IRQ_RISCV_IMSIC_STARTING " Frederic Weisbecker
` (21 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 f32404821731..661648ada894 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] 32+ messages in thread* [RFC PATCH 12/49] irqchip/irq-riscv-imsic-early: Move CPUHP_AP_IRQ_RISCV_IMSIC_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (3 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 10/49] irqchip/sifive-plic: Move CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 14/49] perf/x86: Move CPUHP_AP_PERF_X86_STARTING " Frederic Weisbecker
` (20 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 6acf07afbaf5..ce4e2ece371f 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] 32+ messages in thread* [RFC PATCH 14/49] perf/x86: Move CPUHP_AP_PERF_X86_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (4 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 12/49] irqchip/irq-riscv-imsic-early: Move CPUHP_AP_IRQ_RISCV_IMSIC_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:34 ` sashiko-bot
2026-10-19 13:08 ` [RFC PATCH 15/49] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING " Frederic Weisbecker
` (19 subsequent siblings)
25 siblings, 1 reply; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 5ac2a925f7d6..c37fa1272d57 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] 32+ messages in thread* Re: [RFC PATCH 14/49] perf/x86: Move CPUHP_AP_PERF_X86_STARTING post stop_machine()
2026-10-19 13:08 ` [RFC PATCH 14/49] perf/x86: Move CPUHP_AP_PERF_X86_STARTING " Frederic Weisbecker
@ 2026-10-19 13:34 ` sashiko-bot
0 siblings, 0 replies; 32+ messages in thread
From: sashiko-bot @ 2026-10-19 13:34 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/20261019130856.49711-1-frederic@kernel.org?part=14
^ permalink raw reply [flat|nested] 32+ messages in thread
* [RFC PATCH 15/49] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (5 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 14/49] perf/x86: Move CPUHP_AP_PERF_X86_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:30 ` sashiko-bot
2026-10-19 13:08 ` [RFC PATCH 16/49] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING " Frederic Weisbecker
` (18 subsequent siblings)
25 siblings, 1 reply; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 c37fa1272d57..5a46372a8501 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] 32+ messages in thread* Re: [RFC PATCH 15/49] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING post stop_machine()
2026-10-19 13:08 ` [RFC PATCH 15/49] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING " Frederic Weisbecker
@ 2026-10-19 13:30 ` sashiko-bot
0 siblings, 0 replies; 32+ messages in thread
From: sashiko-bot @ 2026-10-19 13:30 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/20261019130856.49711-1-frederic@kernel.org?part=15
^ permalink raw reply [flat|nested] 32+ messages in thread
* [RFC PATCH 16/49] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (6 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 15/49] perf/amd/ibs: Move CPUHP_AP_PERF_X86_AMD_IBS_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:29 ` sashiko-bot
2026-10-19 13:08 ` [RFC PATCH 17/49] ARM: vfp: Move CPUHP_AP_ARM_VFP_STARTING " Frederic Weisbecker
` (17 subsequent siblings)
25 siblings, 1 reply; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 5a46372a8501..c20a822df803 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] 32+ messages in thread* [RFC PATCH 17/49] ARM: vfp: Move CPUHP_AP_ARM_VFP_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (7 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 16/49] cpu: Move CPUHP_AP_PERF_XTENSA_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 19/49] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING " Frederic Weisbecker
` (16 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 UTC (permalink / raw)
To: LKML
Cc: Frederic Weisbecker, Marco Crivellari, Peter Zijlstra, Phil Auld,
Russell King, Thomas Gleixner, Waiman Long, linux-arm-kernel
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 c20a822df803..b7f5d0683ff7 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] 32+ messages in thread* [RFC PATCH 19/49] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (8 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 17/49] ARM: vfp: Move CPUHP_AP_ARM_VFP_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:34 ` sashiko-bot
2026-10-19 13:08 ` Frederic Weisbecker
` (15 subsequent siblings)
25 siblings, 1 reply; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 7d7e2d1eda9b..95cc6655cf7b 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] 32+ messages in thread* Re: [RFC PATCH 19/49] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING post stop_machine()
2026-10-19 13:08 ` [RFC PATCH 19/49] perf/arm_pmu: Move CPUHP_AP_PERF_ARM_STARTING " Frederic Weisbecker
@ 2026-10-19 13:34 ` sashiko-bot
0 siblings, 0 replies; 32+ messages in thread
From: sashiko-bot @ 2026-10-19 13:34 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/20261019130856.49711-1-frederic@kernel.org?part=19
^ permalink raw reply [flat|nested] 32+ messages in thread
* [RFC PATCH 20/49] perf: RISC-V: Move CPUHP_AP_PERF_RISCV_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 07/49] irqchip/bcm2836: Move CPUHP_AP_IRQ_BCM2836_STARTING " Frederic Weisbecker
` (24 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 95cc6655cf7b..c69a265e4383 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] 32+ messages in thread* [RFC PATCH 20/49] perf: RISC-V: Move CPUHP_AP_PERF_RISCV_STARTING post stop_machine()
@ 2026-10-19 13:08 ` Frederic Weisbecker
0 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 95cc6655cf7b..c69a265e4383 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] 32+ messages in thread* Re: [RFC PATCH 20/49] perf: RISC-V: Move CPUHP_AP_PERF_RISCV_STARTING post stop_machine()
2026-10-19 13:08 ` Frederic Weisbecker
(?)
@ 2026-10-19 13:34 ` sashiko-bot
-1 siblings, 0 replies; 32+ messages in thread
From: sashiko-bot @ 2026-10-19 13:34 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/20261019130856.49711-1-frederic@kernel.org?part=20
^ permalink raw reply [flat|nested] 32+ messages in thread
* [RFC PATCH 21/49] ARM: l2c: Move CPUHP_AP_ARM_L2X0_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (10 preceding siblings ...)
2026-10-19 13:08 ` Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 22/49] clocksource/drivers/exynos_mct: Move CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING " Frederic Weisbecker
` (13 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 UTC (permalink / raw)
To: LKML
Cc: Frederic Weisbecker, Marco Crivellari, Peter Zijlstra, Phil Auld,
Russell King, Thomas Gleixner, Waiman Long, linux-arm-kernel
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 c69a265e4383..c08ef67e3499 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] 32+ messages in thread* [RFC PATCH 22/49] clocksource/drivers/exynos_mct: Move CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (11 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 21/49] ARM: l2c: Move CPUHP_AP_ARM_L2X0_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 23/49] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_STARTING " Frederic Weisbecker
` (12 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 c08ef67e3499..27e6542fb6c4 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] 32+ messages in thread* [RFC PATCH 23/49] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (12 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 22/49] clocksource/drivers/exynos_mct: Move CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 24/49] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING " Frederic Weisbecker
` (11 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 27e6542fb6c4..90d37ee0f282 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] 32+ messages in thread* [RFC PATCH 24/49] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (13 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 23/49] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 25/49] clocksource/drivers/arm_global_timer: Move CPUHP_AP_ARM_GLOBAL_TIMER_STARTING " Frederic Weisbecker
` (10 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 90d37ee0f282..ca335111abb2 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] 32+ messages in thread* [RFC PATCH 25/49] clocksource/drivers/arm_global_timer: Move CPUHP_AP_ARM_GLOBAL_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (14 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 24/49] clocksource/drivers/arm_arch_timer: Move CPUHP_AP_ARM_ARCH_TIMER_EVTSTRM_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 27/49] ARM: smp_twd: Move CPUHP_AP_ARM_TWD_STARTING " Frederic Weisbecker
` (9 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 ca335111abb2..7bc94829b68c 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] 32+ messages in thread* [RFC PATCH 27/49] ARM: smp_twd: Move CPUHP_AP_ARM_TWD_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (15 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 25/49] clocksource/drivers/arm_global_timer: Move CPUHP_AP_ARM_GLOBAL_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 29/49] clocksource/drivers/timer-tegra: Move CPUHP_AP_TEGRA_TIMER_STARTING " Frederic Weisbecker
` (8 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 UTC (permalink / raw)
To: LKML
Cc: Frederic Weisbecker, Marco Crivellari, Peter Zijlstra, Phil Auld,
Russell King, Thomas Gleixner, Waiman Long, linux-arm-kernel
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 1b3942012f2d..1a98d05c7f55 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] 32+ messages in thread* [RFC PATCH 29/49] clocksource/drivers/timer-tegra: Move CPUHP_AP_TEGRA_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (16 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 27/49] ARM: smp_twd: Move CPUHP_AP_ARM_TWD_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 31/49] LoongArch: Move CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING " Frederic Weisbecker
` (7 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 ba90e385d31f..6377149f6a5e 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] 32+ messages in thread* [RFC PATCH 31/49] LoongArch: Move CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (17 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 29/49] clocksource/drivers/timer-tegra: Move CPUHP_AP_TEGRA_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 32/49] clocksource/drivers/mips-gic-timer: Move CPUHP_AP_MIPS_GIC_TIMER_STARTING " Frederic Weisbecker
` (6 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 daad3b496854..664831c50f0b 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] 32+ messages in thread* [RFC PATCH 32/49] clocksource/drivers/mips-gic-timer: Move CPUHP_AP_MIPS_GIC_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (18 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 31/49] LoongArch: Move CPUHP_AP_LOONGARCH_ARCH_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 33/49] clocksource/drivers/arc_timer: Move CPUHP_AP_ARC_TIMER_STARTING " Frederic Weisbecker
` (5 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 UTC (permalink / raw)
To: LKML
Cc: Frederic Weisbecker, Daniel Lezcano, Marco Crivellari,
Peter Zijlstra, Phil Auld, Thomas Bogendoerfer, Thomas Gleixner,
Waiman Long, linux-mips
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 664831c50f0b..e648df00c6c1 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] 32+ messages in thread* [RFC PATCH 33/49] clocksource/drivers/arc_timer: Move CPUHP_AP_ARC_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (19 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 32/49] clocksource/drivers/mips-gic-timer: Move CPUHP_AP_MIPS_GIC_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 35/49] clocksource/drivers/timer-riscv: Move CPUHP_AP_RISCV_TIMER_STARTING " Frederic Weisbecker
` (4 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 e648df00c6c1..75f4cae8971e 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] 32+ messages in thread* [RFC PATCH 35/49] clocksource/drivers/timer-riscv: Move CPUHP_AP_RISCV_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (20 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 33/49] clocksource/drivers/arc_timer: Move CPUHP_AP_ARC_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 37/49] clocksource/drivers/c-sky: Move CPUHP_AP_CSKY_TIMER_STARTING " Frederic Weisbecker
` (3 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 374e7599baae..c2f25b6f72a4 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] 32+ messages in thread* [RFC PATCH 37/49] clocksource/drivers/c-sky: Move CPUHP_AP_CSKY_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (21 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 35/49] clocksource/drivers/timer-riscv: Move CPUHP_AP_RISCV_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 39/49] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING " Frederic Weisbecker
` (2 subsequent siblings)
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 UTC (permalink / raw)
To: LKML
Cc: Frederic Weisbecker, Daniel Lezcano, Guo Ren, Marco Crivellari,
Peter Zijlstra, Phil Auld, Thomas Gleixner, Waiman Long,
linux-csky
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 9735d6cd01d8..f8c8fbbd0628 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] 32+ messages in thread* [RFC PATCH 39/49] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (22 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 37/49] clocksource/drivers/c-sky: Move CPUHP_AP_CSKY_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 41/49] ARM: xen: Move CPUHP_AP_ARM_XEN_STARTING " Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 49/49] ARM: mm: Move CPUHP_AP_ARM_CACHE_B15_RAC_DYING " Frederic Weisbecker
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 c2356a36d345..c37fe84baaa8 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] 32+ messages in thread* [RFC PATCH 41/49] ARM: xen: Move CPUHP_AP_ARM_XEN_STARTING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (23 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 39/49] clocksource: hyper-v: Move CPUHP_AP_HYPERV_TIMER_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
2026-10-19 13:08 ` [RFC PATCH 49/49] ARM: mm: Move CPUHP_AP_ARM_CACHE_B15_RAC_DYING " Frederic Weisbecker
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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 bc06cb1f0282..8509c6377a61 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] 32+ messages in thread* [RFC PATCH 49/49] ARM: mm: Move CPUHP_AP_ARM_CACHE_B15_RAC_DYING post stop_machine()
[not found] <20261019130856.49711-1-frederic@kernel.org>
` (24 preceding siblings ...)
2026-10-19 13:08 ` [RFC PATCH 41/49] ARM: xen: Move CPUHP_AP_ARM_XEN_STARTING " Frederic Weisbecker
@ 2026-10-19 13:08 ` Frederic Weisbecker
25 siblings, 0 replies; 32+ messages in thread
From: Frederic Weisbecker @ 2026-10-19 13:08 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
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().
It *looks ok* to disable the cache readahead globally while the other
CPUs are running.
Move this teardown callback to post stop_machine() accordingly.
But please double check.
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 87680f7c6493..36f8e6588196 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] 32+ messages in thread