* Re: [PATCH] sched/hotplug: Remove unused idle_task_exit
2026-10-16 9:56 [PATCH] sched/hotplug: Remove unused idle_task_exit Srikar Dronamraju
@ 2026-10-23 13:40 ` Frederic Weisbecker
2026-10-23 16:54 ` Peter Zijlstra
2026-10-26 2:03 ` Jinjie Ruan
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Frederic Weisbecker @ 2026-10-23 13:40 UTC (permalink / raw)
To: Srikar Dronamraju
Cc: Ingo Molnar, Peter Zijlstra, Russell King, Catalin Marinas,
Will Deacon, Guo Ren, Huacai Chen, WANG Xuerui,
Thomas Bogendoerfer, Florian Fainelli,
Broadcom internal kernel review list, Jiaxun Yang,
James E.J. Bottomley, Helge Deller, Scott Wood,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
David S. Miller, Andreas Larsson, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, Chris Zankel,
Max Filippov, LKML, Srikar Dronamraju, Dietmar Eggemann,
Kees Cook, Jinjie Ruan, mrigendrachaubey, Marc Zyngier,
Pengjie Zhang, Thierry Reding, Xi Ruoyao,
Rafael J. Wysocki (Intel), Tiezhu Yang, Rong Bao, Hui Wang,
Thorsten Blum, Josh Poimboeuf, linux-arm-kernel, linux-csky,
loongarch, linux-mips, linux-parisc, linuxppc-dev, linux-riscv,
linux-s390, linux-sh, sparclinux
Le Fri, Oct 16, 2026 at 03:26:40PM +0530, Srikar Dronamraju a écrit :
> Commit 21641bd9a7a7 ("lazy tlb: fix hotplug exit race with
> MMU_LAZY_TLB_SHOOTDOWN") moved the handling previously performed by
> idle_task_exit() into the scheduler CPU hotplug path using
> sched_force_init_mm().
>
> As a result, idle_task_exit() is now an empty stub and the remaining
> architecture call sites have no effect.
>
> Remove the calls to idle_task_exit() and the now unused stub.
>
> Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
--
Frederic Weisbecker
SUSE Labs
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] sched/hotplug: Remove unused idle_task_exit
2026-10-23 13:40 ` Frederic Weisbecker
@ 2026-10-23 16:54 ` Peter Zijlstra
2026-10-25 18:47 ` Frederic Weisbecker
0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2026-10-23 16:54 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: Srikar Dronamraju, Ingo Molnar, Russell King, Catalin Marinas,
Will Deacon, Guo Ren, Huacai Chen, WANG Xuerui,
Thomas Bogendoerfer, Florian Fainelli,
Broadcom internal kernel review list, Jiaxun Yang,
James E.J. Bottomley, Helge Deller, Scott Wood,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
David S. Miller, Andreas Larsson, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, Chris Zankel,
Max Filippov, LKML, Srikar Dronamraju, Dietmar Eggemann,
Kees Cook, Jinjie Ruan, mrigendrachaubey, Marc Zyngier,
Pengjie Zhang, Thierry Reding, Xi Ruoyao,
Rafael J. Wysocki (Intel), Tiezhu Yang, Rong Bao, Hui Wang,
Thorsten Blum, Josh Poimboeuf, linux-arm-kernel, linux-csky,
loongarch, linux-mips, linux-parisc, linuxppc-dev, linux-riscv,
linux-s390, linux-sh, sparclinux
On Fri, Oct 23, 2026 at 03:40:15PM +0200, Frederic Weisbecker wrote:
> Le Fri, Oct 16, 2026 at 03:26:40PM +0530, Srikar Dronamraju a écrit :
> > Commit 21641bd9a7a7 ("lazy tlb: fix hotplug exit race with
> > MMU_LAZY_TLB_SHOOTDOWN") moved the handling previously performed by
> > idle_task_exit() into the scheduler CPU hotplug path using
> > sched_force_init_mm().
> >
> > As a result, idle_task_exit() is now an empty stub and the remaining
> > architecture call sites have no effect.
> >
> > Remove the calls to idle_task_exit() and the now unused stub.
> >
> > Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
>
> Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Excellent; less is more and all that. Shall I take this through the
scheduler tree?
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] sched/hotplug: Remove unused idle_task_exit
2026-10-23 16:54 ` Peter Zijlstra
@ 2026-10-25 18:47 ` Frederic Weisbecker
0 siblings, 0 replies; 8+ messages in thread
From: Frederic Weisbecker @ 2026-10-25 18:47 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Srikar Dronamraju, Ingo Molnar, Russell King, Catalin Marinas,
Will Deacon, Guo Ren, Huacai Chen, WANG Xuerui,
Thomas Bogendoerfer, Florian Fainelli,
Broadcom internal kernel review list, Jiaxun Yang,
James E.J. Bottomley, Helge Deller, Scott Wood,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
David S. Miller, Andreas Larsson, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, Chris Zankel,
Max Filippov, LKML, Srikar Dronamraju, Dietmar Eggemann,
Kees Cook, Jinjie Ruan, mrigendrachaubey, Marc Zyngier,
Pengjie Zhang, Thierry Reding, Xi Ruoyao,
Rafael J. Wysocki (Intel), Tiezhu Yang, Rong Bao, Hui Wang,
Thorsten Blum, Josh Poimboeuf, linux-arm-kernel, linux-csky,
loongarch, linux-mips, linux-parisc, linuxppc-dev, linux-riscv,
linux-s390, linux-sh, sparclinux
Le Fri, Oct 23, 2026 at 06:54:34PM +0200, Peter Zijlstra a écrit :
> On Fri, Oct 23, 2026 at 03:40:15PM +0200, Frederic Weisbecker wrote:
> > Le Fri, Oct 16, 2026 at 03:26:40PM +0530, Srikar Dronamraju a écrit :
> > > Commit 21641bd9a7a7 ("lazy tlb: fix hotplug exit race with
> > > MMU_LAZY_TLB_SHOOTDOWN") moved the handling previously performed by
> > > idle_task_exit() into the scheduler CPU hotplug path using
> > > sched_force_init_mm().
> > >
> > > As a result, idle_task_exit() is now an empty stub and the remaining
> > > architecture call sites have no effect.
> > >
> > > Remove the calls to idle_task_exit() and the now unused stub.
> > >
> > > Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
> >
> > Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
>
> Excellent; less is more and all that. Shall I take this through the
> scheduler tree?
Yes please :-)
--
Frederic Weisbecker
SUSE Labs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sched/hotplug: Remove unused idle_task_exit
2026-10-16 9:56 [PATCH] sched/hotplug: Remove unused idle_task_exit Srikar Dronamraju
2026-10-23 13:40 ` Frederic Weisbecker
@ 2026-10-26 2:03 ` Jinjie Ruan
2026-11-09 8:43 ` [tip: sched/core] " tip-bot2 for Srikar Dronamraju
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Jinjie Ruan @ 2026-10-26 2:03 UTC (permalink / raw)
To: Srikar Dronamraju, Ingo Molnar, Peter Zijlstra, Russell King,
Catalin Marinas, Will Deacon, Guo Ren, Huacai Chen, WANG Xuerui,
Thomas Bogendoerfer, Florian Fainelli,
Broadcom internal kernel review list, Jiaxun Yang,
James E.J. Bottomley, Helge Deller, Scott Wood,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
David S. Miller, Andreas Larsson, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, Chris Zankel,
Max Filippov
Cc: LKML, Srikar Dronamraju, Dietmar Eggemann, Kees Cook,
mrigendrachaubey, Marc Zyngier, Pengjie Zhang, Thierry Reding,
Xi Ruoyao, Rafael J. Wysocki (Intel), Tiezhu Yang, Rong Bao,
Hui Wang, Frederic Weisbecker, Thorsten Blum, Josh Poimboeuf,
linux-arm-kernel, linux-csky, loongarch, linux-mips, linux-parisc,
linuxppc-dev, linux-riscv, linux-s390, linux-sh, sparclinux
在 2026/10/16 17:56, Srikar Dronamraju 写道:
> Commit 21641bd9a7a7 ("lazy tlb: fix hotplug exit race with
> MMU_LAZY_TLB_SHOOTDOWN") moved the handling previously performed by
> idle_task_exit() into the scheduler CPU hotplug path using
> sched_force_init_mm().
>
> As a result, idle_task_exit() is now an empty stub and the remaining
> architecture call sites have no effect.
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
>
> Remove the calls to idle_task_exit() and the now unused stub.
>
> Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
> ---
> arch/arm/kernel/smp.c | 2 --
> arch/arm64/kernel/smp.c | 2 --
> arch/csky/kernel/smp.c | 2 --
> arch/loongarch/kernel/smp.c | 2 --
> arch/mips/cavium-octeon/smp.c | 1 -
> arch/mips/kernel/smp-bmips.c | 1 -
> arch/mips/kernel/smp-cps.c | 1 -
> arch/mips/loongson64/smp.c | 1 -
> arch/parisc/kernel/process.c | 2 --
> arch/powerpc/platforms/85xx/smp.c | 2 --
> arch/powerpc/platforms/powermac/smp.c | 2 --
> arch/powerpc/platforms/powernv/smp.c | 1 -
> arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 --
> arch/powerpc/platforms/pseries/pmem.c | 1 -
> arch/riscv/kernel/cpu-hotplug.c | 2 --
> arch/s390/kernel/smp.c | 1 -
> arch/sh/kernel/smp.c | 1 -
> arch/sparc/kernel/smp_64.c | 2 --
> arch/x86/kernel/smpboot.c | 2 --
> arch/xtensa/kernel/smp.c | 1 -
> include/linux/sched/hotplug.h | 2 --
> 21 files changed, 33 deletions(-)
>
> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> index b5fb4697bc3f..bbfbbe728b7a 100644
> --- a/arch/arm/kernel/smp.c
> +++ b/arch/arm/kernel/smp.c
> @@ -319,8 +319,6 @@ void __noreturn arch_cpu_idle_dead(void)
> {
> unsigned int cpu = smp_processor_id();
>
> - idle_task_exit();
> -
> local_irq_disable();
>
> /*
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index a61dc3016a11..afb5aa65d737 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -370,8 +370,6 @@ void __noreturn cpu_die(void)
> unsigned int cpu = smp_processor_id();
> const struct cpu_operations *ops = get_cpu_ops(cpu);
>
> - idle_task_exit();
> -
> local_daif_mask();
>
> /* Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose of */
> diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c
> index 92dbbf3e0205..e6333ccc335a 100644
> --- a/arch/csky/kernel/smp.c
> +++ b/arch/csky/kernel/smp.c
> @@ -294,8 +294,6 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
>
> void __noreturn arch_cpu_idle_dead(void)
> {
> - idle_task_exit();
> -
> cpuhp_ap_report_dead();
>
> while (!secondary_stack)
> diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c
> index 11f54837f56c..6b21af1c25e0 100644
> --- a/arch/loongarch/kernel/smp.c
> +++ b/arch/loongarch/kernel/smp.c
> @@ -478,7 +478,6 @@ static void __noreturn idle_play_dead(void)
> register uint64_t addr;
> register void (*init_fn)(void);
>
> - idle_task_exit();
> local_irq_enable();
> set_csr_ecfg(ECFGF_IPI);
> __this_cpu_write(cpu_state, CPU_DEAD);
> @@ -503,7 +502,6 @@ static void __noreturn poll_play_dead(void)
> register uint64_t addr;
> register void (*init_fn)(void);
>
> - idle_task_exit();
> __this_cpu_write(cpu_state, CPU_DEAD);
>
> __smp_mb();
> diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
> index 054e331b3202..0e557e76d616 100644
> --- a/arch/mips/cavium-octeon/smp.c
> +++ b/arch/mips/cavium-octeon/smp.c
> @@ -344,7 +344,6 @@ void play_dead(void)
> {
> int cpu = cpu_number_map(cvmx_get_core_num());
>
> - idle_task_exit();
> cpuhp_ap_report_dead();
> octeon_processor_boot = 0xff;
> per_cpu(cpu_state, cpu) = CPU_DEAD;
> diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
> index 35b8d810833c..e4a523b7c988 100644
> --- a/arch/mips/kernel/smp-bmips.c
> +++ b/arch/mips/kernel/smp-bmips.c
> @@ -391,7 +391,6 @@ static void bmips_cpu_die(unsigned int cpu)
>
> void __ref play_dead(void)
> {
> - idle_task_exit();
> cpuhp_ap_report_dead();
>
> /* flush data cache */
> diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
> index b01ebaace48e..51e68a42bcc8 100644
> --- a/arch/mips/kernel/smp-cps.c
> +++ b/arch/mips/kernel/smp-cps.c
> @@ -804,7 +804,6 @@ void play_dead(void)
> unsigned int cpu;
>
> local_irq_disable();
> - idle_task_exit();
> cpu = smp_processor_id();
> cpu_death = CPU_DEATH_POWER;
>
> diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c
> index e584299d0fde..73eca9c44b04 100644
> --- a/arch/mips/loongson64/smp.c
> +++ b/arch/mips/loongson64/smp.c
> @@ -766,7 +766,6 @@ void play_dead(void)
> unsigned int cpu = smp_processor_id();
> void (*play_dead_at_ckseg1)(int *);
>
> - idle_task_exit();
> cpuhp_ap_report_dead();
>
> prid_imp = read_c0_prid() & PRID_IMP_MASK;
> diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
> index 703644e5bfc4..8606ecde4c30 100644
> --- a/arch/parisc/kernel/process.c
> +++ b/arch/parisc/kernel/process.c
> @@ -164,8 +164,6 @@ EXPORT_SYMBOL(running_on_qemu);
> void __noreturn arch_cpu_idle_dead(void)
> {
> #ifdef CONFIG_HOTPLUG_CPU
> - idle_task_exit();
> -
> local_irq_disable();
>
> /* Tell the core that this CPU is now safe to dispose of. */
> diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
> index 32fa5fb557c0..9dc81e4226f0 100644
> --- a/arch/powerpc/platforms/85xx/smp.c
> +++ b/arch/powerpc/platforms/85xx/smp.c
> @@ -121,8 +121,6 @@ static void smp_85xx_cpu_offline_self(void)
> /* mask all irqs to prevent cpu wakeup */
> qoriq_pm_ops->irq_mask(cpu);
>
> - idle_task_exit();
> -
> mtspr(SPRN_TCR, 0);
> mtspr(SPRN_TSR, mfspr(SPRN_TSR));
>
> diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
> index 88e92af8acf9..f8e674cfcdd7 100644
> --- a/arch/powerpc/platforms/powermac/smp.c
> +++ b/arch/powerpc/platforms/powermac/smp.c
> @@ -925,7 +925,6 @@ static void pmac_cpu_offline_self(void)
> int cpu = smp_processor_id();
>
> local_irq_disable();
> - idle_task_exit();
> pr_debug("CPU%d offline\n", cpu);
> generic_set_cpu_dead(cpu);
> smp_wmb();
> @@ -940,7 +939,6 @@ static void pmac_cpu_offline_self(void)
> int cpu = smp_processor_id();
>
> local_irq_disable();
> - idle_task_exit();
>
> /*
> * turn off as much as possible, we'll be
> diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
> index b1201dbafcaf..9a480c924020 100644
> --- a/arch/powerpc/platforms/powernv/smp.c
> +++ b/arch/powerpc/platforms/powernv/smp.c
> @@ -172,7 +172,6 @@ static void pnv_cpu_offline_self(void)
>
> /* Standard hot unplug procedure */
>
> - idle_task_exit();
> cpu = smp_processor_id();
> DBG("CPU%d offline\n", cpu);
> generic_set_cpu_dead(cpu);
> diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> index bc6926dbf148..1ade9a811157 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> @@ -19,7 +19,6 @@
> #include <linux/kernel.h>
> #include <linux/interrupt.h>
> #include <linux/delay.h>
> -#include <linux/sched.h> /* for idle_task_exit */
> #include <linux/sched/hotplug.h>
> #include <linux/cpu.h>
> #include <linux/of.h>
> @@ -64,7 +63,6 @@ static void pseries_cpu_offline_self(void)
> unsigned int hwcpu = hard_smp_processor_id();
>
> local_irq_disable();
> - idle_task_exit();
> if (xive_enabled())
> xive_teardown_cpu();
> else
> diff --git a/arch/powerpc/platforms/pseries/pmem.c b/arch/powerpc/platforms/pseries/pmem.c
> index 0f1d45f32e4a..af48dfebb640 100644
> --- a/arch/powerpc/platforms/pseries/pmem.c
> +++ b/arch/powerpc/platforms/pseries/pmem.c
> @@ -9,7 +9,6 @@
> #include <linux/kernel.h>
> #include <linux/interrupt.h>
> #include <linux/delay.h>
> -#include <linux/sched.h> /* for idle_task_exit */
> #include <linux/sched/hotplug.h>
> #include <linux/cpu.h>
> #include <linux/of.h>
> diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c
> index 0bc56d8381b6..348043122593 100644
> --- a/arch/riscv/kernel/cpu-hotplug.c
> +++ b/arch/riscv/kernel/cpu-hotplug.c
> @@ -66,8 +66,6 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
> */
> void __noreturn arch_cpu_idle_dead(void)
> {
> - idle_task_exit();
> -
> cpuhp_ap_report_dead();
>
> cpu_ops->cpu_stop();
> diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
> index 32499cad86f0..dd1d40ec5440 100644
> --- a/arch/s390/kernel/smp.c
> +++ b/arch/s390/kernel/smp.c
> @@ -918,7 +918,6 @@ void __cpu_die(unsigned int cpu)
>
> void __noreturn cpu_die(void)
> {
> - idle_task_exit();
> pcpu_sigp_retry(this_cpu_ptr(&pcpu_devices), SIGP_STOP, 0);
> for (;;) ;
> }
> diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
> index 108d808767fa..afd57bdce04e 100644
> --- a/arch/sh/kernel/smp.c
> +++ b/arch/sh/kernel/smp.c
> @@ -108,7 +108,6 @@ int native_cpu_disable(unsigned int cpu)
>
> void play_dead_common(void)
> {
> - idle_task_exit();
> irq_ctx_exit(raw_smp_processor_id());
> mb();
>
> diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
> index 371460e34484..e98b5ddebc9e 100644
> --- a/arch/sparc/kernel/smp_64.c
> +++ b/arch/sparc/kernel/smp_64.c
> @@ -1290,8 +1290,6 @@ void cpu_play_dead(void)
> int cpu = smp_processor_id();
> unsigned long pstate;
>
> - idle_task_exit();
> -
> if (tlb_type == hypervisor) {
> struct trap_per_cpu *tb = &trap_block[cpu];
>
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index ba01a9e919b7..dcbaf3f27862 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -1407,8 +1407,6 @@ int native_cpu_disable(void)
>
> void play_dead_common(void)
> {
> - idle_task_exit();
> -
> cpuhp_ap_report_dead();
>
> local_irq_disable();
> diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c
> index e4c25d0c2158..094e1da933a6 100644
> --- a/arch/xtensa/kernel/smp.c
> +++ b/arch/xtensa/kernel/smp.c
> @@ -336,7 +336,6 @@ void __noreturn arch_cpu_idle_dead(void)
> */
> void __ref cpu_die(void)
> {
> - idle_task_exit();
> local_irq_disable();
> __asm__ __volatile__(
> " movi a2, cpu_restart\n"
> diff --git a/include/linux/sched/hotplug.h b/include/linux/sched/hotplug.h
> index 17e04859b9a4..18fa3e63123e 100644
> --- a/include/linux/sched/hotplug.h
> +++ b/include/linux/sched/hotplug.h
> @@ -18,6 +18,4 @@ extern int sched_cpu_dying(unsigned int cpu);
> # define sched_cpu_dying NULL
> #endif
>
> -static inline void idle_task_exit(void) {}
> -
> #endif /* _LINUX_SCHED_HOTPLUG_H */
--
Best regards,
Jinjie
^ permalink raw reply [flat|nested] 8+ messages in thread* [tip: sched/core] sched/hotplug: Remove unused idle_task_exit
2026-10-16 9:56 [PATCH] sched/hotplug: Remove unused idle_task_exit Srikar Dronamraju
2026-10-23 13:40 ` Frederic Weisbecker
2026-10-26 2:03 ` Jinjie Ruan
@ 2026-11-09 8:43 ` tip-bot2 for Srikar Dronamraju
2026-11-09 9:28 ` tip-bot2 for Srikar Dronamraju
2026-11-09 10:01 ` tip-bot2 for Srikar Dronamraju
4 siblings, 0 replies; 8+ messages in thread
From: tip-bot2 for Srikar Dronamraju @ 2026-11-09 8:43 UTC (permalink / raw)
To: linux-tip-commits
Cc: Srikar Dronamraju, Peter Zijlstra (Intel), Frederic Weisbecker,
x86, linux-kernel
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 3ab90dd656a7995e26b9aa0e00a9a89ed9b880b3
Gitweb: https://git.kernel.org/tip/3ab90dd656a7995e26b9aa0e00a9a89ed9b880b3
Author: Srikar Dronamraju <srikar@linux.ibm.com>
AuthorDate: Fri, 16 Oct 2026 15:26:40 +05:30
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 09 Nov 2026 09:39:59 +01:00
sched/hotplug: Remove unused idle_task_exit
Commit 21641bd9a7a7 ("lazy tlb: fix hotplug exit race with
MMU_LAZY_TLB_SHOOTDOWN") moved the handling previously performed by
idle_task_exit() into the scheduler CPU hotplug path using
sched_force_init_mm().
As a result, idle_task_exit() is now an empty stub and the remaining
architecture call sites have no effect.
Remove the calls to idle_task_exit() and the now unused stub.
Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://patch.msgid.link/20261016095711.1364609-1-srikar@linux.ibm.com
---
arch/arm/kernel/smp.c | 2 --
arch/arm64/kernel/smp.c | 2 --
arch/csky/kernel/smp.c | 2 --
arch/loongarch/kernel/smp.c | 2 --
arch/mips/cavium-octeon/smp.c | 1 -
arch/mips/kernel/smp-bmips.c | 1 -
arch/mips/kernel/smp-cps.c | 1 -
arch/mips/loongson64/smp.c | 1 -
arch/parisc/kernel/process.c | 2 --
arch/powerpc/platforms/85xx/smp.c | 2 --
arch/powerpc/platforms/powermac/smp.c | 2 --
arch/powerpc/platforms/powernv/smp.c | 1 -
arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 --
arch/powerpc/platforms/pseries/pmem.c | 1 -
arch/riscv/kernel/cpu-hotplug.c | 2 --
arch/s390/kernel/smp.c | 1 -
arch/sh/kernel/smp.c | 1 -
arch/sparc/kernel/smp_64.c | 2 --
arch/x86/kernel/smpboot.c | 2 --
arch/xtensa/kernel/smp.c | 1 -
include/linux/sched/hotplug.h | 2 --
21 files changed, 33 deletions(-)
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index a9f4600..eed8c2c 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -319,8 +319,6 @@ void __noreturn arch_cpu_idle_dead(void)
{
unsigned int cpu = smp_processor_id();
- idle_task_exit();
-
local_irq_disable();
/*
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 014b163..48b425e 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -372,8 +372,6 @@ void __noreturn cpu_die(void)
unsigned int cpu = smp_processor_id();
const struct cpu_operations *ops = get_cpu_ops(cpu);
- idle_task_exit();
-
local_daif_mask();
/* Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose of */
diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c
index 92dbbf3..e6333cc 100644
--- a/arch/csky/kernel/smp.c
+++ b/arch/csky/kernel/smp.c
@@ -294,8 +294,6 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
void __noreturn arch_cpu_idle_dead(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
while (!secondary_stack)
diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c
index 11f5483..6b21af1 100644
--- a/arch/loongarch/kernel/smp.c
+++ b/arch/loongarch/kernel/smp.c
@@ -478,7 +478,6 @@ static void __noreturn idle_play_dead(void)
register uint64_t addr;
register void (*init_fn)(void);
- idle_task_exit();
local_irq_enable();
set_csr_ecfg(ECFGF_IPI);
__this_cpu_write(cpu_state, CPU_DEAD);
@@ -503,7 +502,6 @@ static void __noreturn poll_play_dead(void)
register uint64_t addr;
register void (*init_fn)(void);
- idle_task_exit();
__this_cpu_write(cpu_state, CPU_DEAD);
__smp_mb();
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index 054e331..0e557e7 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -344,7 +344,6 @@ void play_dead(void)
{
int cpu = cpu_number_map(cvmx_get_core_num());
- idle_task_exit();
cpuhp_ap_report_dead();
octeon_processor_boot = 0xff;
per_cpu(cpu_state, cpu) = CPU_DEAD;
diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
index 35b8d81..e4a523b 100644
--- a/arch/mips/kernel/smp-bmips.c
+++ b/arch/mips/kernel/smp-bmips.c
@@ -391,7 +391,6 @@ static void bmips_cpu_die(unsigned int cpu)
void __ref play_dead(void)
{
- idle_task_exit();
cpuhp_ap_report_dead();
/* flush data cache */
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index b01ebaa..51e68a4 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -804,7 +804,6 @@ void play_dead(void)
unsigned int cpu;
local_irq_disable();
- idle_task_exit();
cpu = smp_processor_id();
cpu_death = CPU_DEATH_POWER;
diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c
index e584299..73eca9c 100644
--- a/arch/mips/loongson64/smp.c
+++ b/arch/mips/loongson64/smp.c
@@ -766,7 +766,6 @@ void play_dead(void)
unsigned int cpu = smp_processor_id();
void (*play_dead_at_ckseg1)(int *);
- idle_task_exit();
cpuhp_ap_report_dead();
prid_imp = read_c0_prid() & PRID_IMP_MASK;
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 703644e..8606ecd 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -164,8 +164,6 @@ EXPORT_SYMBOL(running_on_qemu);
void __noreturn arch_cpu_idle_dead(void)
{
#ifdef CONFIG_HOTPLUG_CPU
- idle_task_exit();
-
local_irq_disable();
/* Tell the core that this CPU is now safe to dispose of. */
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 32fa5fb..9dc81e4 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -121,8 +121,6 @@ static void smp_85xx_cpu_offline_self(void)
/* mask all irqs to prevent cpu wakeup */
qoriq_pm_ops->irq_mask(cpu);
- idle_task_exit();
-
mtspr(SPRN_TCR, 0);
mtspr(SPRN_TSR, mfspr(SPRN_TSR));
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 88e92af..f8e674c 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -925,7 +925,6 @@ static void pmac_cpu_offline_self(void)
int cpu = smp_processor_id();
local_irq_disable();
- idle_task_exit();
pr_debug("CPU%d offline\n", cpu);
generic_set_cpu_dead(cpu);
smp_wmb();
@@ -940,7 +939,6 @@ static void pmac_cpu_offline_self(void)
int cpu = smp_processor_id();
local_irq_disable();
- idle_task_exit();
/*
* turn off as much as possible, we'll be
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index b1201db..9a480c9 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -172,7 +172,6 @@ static void pnv_cpu_offline_self(void)
/* Standard hot unplug procedure */
- idle_task_exit();
cpu = smp_processor_id();
DBG("CPU%d offline\n", cpu);
generic_set_cpu_dead(cpu);
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index bc6926d..1ade9a8 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -19,7 +19,6 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <linux/sched.h> /* for idle_task_exit */
#include <linux/sched/hotplug.h>
#include <linux/cpu.h>
#include <linux/of.h>
@@ -64,7 +63,6 @@ static void pseries_cpu_offline_self(void)
unsigned int hwcpu = hard_smp_processor_id();
local_irq_disable();
- idle_task_exit();
if (xive_enabled())
xive_teardown_cpu();
else
diff --git a/arch/powerpc/platforms/pseries/pmem.c b/arch/powerpc/platforms/pseries/pmem.c
index 0f1d45f..af48dfe 100644
--- a/arch/powerpc/platforms/pseries/pmem.c
+++ b/arch/powerpc/platforms/pseries/pmem.c
@@ -9,7 +9,6 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <linux/sched.h> /* for idle_task_exit */
#include <linux/sched/hotplug.h>
#include <linux/cpu.h>
#include <linux/of.h>
diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c
index 0bc56d8..3480431 100644
--- a/arch/riscv/kernel/cpu-hotplug.c
+++ b/arch/riscv/kernel/cpu-hotplug.c
@@ -66,8 +66,6 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
*/
void __noreturn arch_cpu_idle_dead(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
cpu_ops->cpu_stop();
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index f7c262a..aa574b8 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -918,7 +918,6 @@ void __cpu_die(unsigned int cpu)
void __noreturn cpu_die(void)
{
- idle_task_exit();
pcpu_sigp_retry(this_cpu_ptr(&pcpu_devices), SIGP_STOP, 0);
for (;;) ;
}
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 108d808..afd57bd 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -108,7 +108,6 @@ int native_cpu_disable(unsigned int cpu)
void play_dead_common(void)
{
- idle_task_exit();
irq_ctx_exit(raw_smp_processor_id());
mb();
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 371460e..e98b5dd 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1290,8 +1290,6 @@ void cpu_play_dead(void)
int cpu = smp_processor_id();
unsigned long pstate;
- idle_task_exit();
-
if (tlb_type == hypervisor) {
struct trap_per_cpu *tb = &trap_block[cpu];
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ba01a9e..dcbaf3f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1407,8 +1407,6 @@ int native_cpu_disable(void)
void play_dead_common(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
local_irq_disable();
diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c
index e4c25d0..094e1da 100644
--- a/arch/xtensa/kernel/smp.c
+++ b/arch/xtensa/kernel/smp.c
@@ -336,7 +336,6 @@ void __noreturn arch_cpu_idle_dead(void)
*/
void __ref cpu_die(void)
{
- idle_task_exit();
local_irq_disable();
__asm__ __volatile__(
" movi a2, cpu_restart\n"
diff --git a/include/linux/sched/hotplug.h b/include/linux/sched/hotplug.h
index 17e0485..18fa3e6 100644
--- a/include/linux/sched/hotplug.h
+++ b/include/linux/sched/hotplug.h
@@ -18,6 +18,4 @@ extern int sched_cpu_dying(unsigned int cpu);
# define sched_cpu_dying NULL
#endif
-static inline void idle_task_exit(void) {}
-
#endif /* _LINUX_SCHED_HOTPLUG_H */
^ permalink raw reply related [flat|nested] 8+ messages in thread* [tip: sched/core] sched/hotplug: Remove unused idle_task_exit
2026-10-16 9:56 [PATCH] sched/hotplug: Remove unused idle_task_exit Srikar Dronamraju
` (2 preceding siblings ...)
2026-11-09 8:43 ` [tip: sched/core] " tip-bot2 for Srikar Dronamraju
@ 2026-11-09 9:28 ` tip-bot2 for Srikar Dronamraju
2026-11-09 10:01 ` tip-bot2 for Srikar Dronamraju
4 siblings, 0 replies; 8+ messages in thread
From: tip-bot2 for Srikar Dronamraju @ 2026-11-09 9:28 UTC (permalink / raw)
To: linux-tip-commits
Cc: Srikar Dronamraju, Peter Zijlstra (Intel), Ingo Molnar,
Frederic Weisbecker, x86, linux-kernel
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 4acfb1255f30a1ed9ea07f9e9a650ebc064aa2eb
Gitweb: https://git.kernel.org/tip/4acfb1255f30a1ed9ea07f9e9a650ebc064aa2eb
Author: Srikar Dronamraju <srikar@linux.ibm.com>
AuthorDate: Fri, 16 Oct 2026 15:26:40 +05:30
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 09 Nov 2026 10:24:01 +01:00
sched/hotplug: Remove unused idle_task_exit
Commit 21641bd9a7a7 ("lazy tlb: fix hotplug exit race with
MMU_LAZY_TLB_SHOOTDOWN") moved the handling previously performed by
idle_task_exit() into the scheduler CPU hotplug path using
sched_force_init_mm().
As a result, idle_task_exit() is now an empty stub and the remaining
architecture call sites have no effect.
Remove the calls to idle_task_exit() and the now unused stub.
Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://patch.msgid.link/20261016095711.1364609-1-srikar@linux.ibm.com
---
arch/arm/kernel/smp.c | 2 --
arch/arm64/kernel/smp.c | 2 --
arch/csky/kernel/smp.c | 2 --
arch/loongarch/kernel/smp.c | 2 --
arch/mips/cavium-octeon/smp.c | 1 -
arch/mips/kernel/smp-bmips.c | 1 -
arch/mips/kernel/smp-cps.c | 1 -
arch/mips/loongson64/smp.c | 1 -
arch/parisc/kernel/process.c | 2 --
arch/powerpc/platforms/85xx/smp.c | 2 --
arch/powerpc/platforms/powermac/smp.c | 2 --
arch/powerpc/platforms/powernv/smp.c | 1 -
arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 --
arch/powerpc/platforms/pseries/pmem.c | 1 -
arch/riscv/kernel/cpu-hotplug.c | 2 --
arch/s390/kernel/smp.c | 1 -
arch/sh/kernel/smp.c | 1 -
arch/sparc/kernel/smp_64.c | 2 --
arch/x86/kernel/smpboot.c | 2 --
arch/xtensa/kernel/smp.c | 1 -
include/linux/sched/hotplug.h | 2 --
21 files changed, 33 deletions(-)
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index a9f4600..eed8c2c 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -319,8 +319,6 @@ void __noreturn arch_cpu_idle_dead(void)
{
unsigned int cpu = smp_processor_id();
- idle_task_exit();
-
local_irq_disable();
/*
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 014b163..48b425e 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -372,8 +372,6 @@ void __noreturn cpu_die(void)
unsigned int cpu = smp_processor_id();
const struct cpu_operations *ops = get_cpu_ops(cpu);
- idle_task_exit();
-
local_daif_mask();
/* Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose of */
diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c
index 92dbbf3..e6333cc 100644
--- a/arch/csky/kernel/smp.c
+++ b/arch/csky/kernel/smp.c
@@ -294,8 +294,6 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
void __noreturn arch_cpu_idle_dead(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
while (!secondary_stack)
diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c
index 11f5483..6b21af1 100644
--- a/arch/loongarch/kernel/smp.c
+++ b/arch/loongarch/kernel/smp.c
@@ -478,7 +478,6 @@ static void __noreturn idle_play_dead(void)
register uint64_t addr;
register void (*init_fn)(void);
- idle_task_exit();
local_irq_enable();
set_csr_ecfg(ECFGF_IPI);
__this_cpu_write(cpu_state, CPU_DEAD);
@@ -503,7 +502,6 @@ static void __noreturn poll_play_dead(void)
register uint64_t addr;
register void (*init_fn)(void);
- idle_task_exit();
__this_cpu_write(cpu_state, CPU_DEAD);
__smp_mb();
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index 054e331..0e557e7 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -344,7 +344,6 @@ void play_dead(void)
{
int cpu = cpu_number_map(cvmx_get_core_num());
- idle_task_exit();
cpuhp_ap_report_dead();
octeon_processor_boot = 0xff;
per_cpu(cpu_state, cpu) = CPU_DEAD;
diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
index 35b8d81..e4a523b 100644
--- a/arch/mips/kernel/smp-bmips.c
+++ b/arch/mips/kernel/smp-bmips.c
@@ -391,7 +391,6 @@ static void bmips_cpu_die(unsigned int cpu)
void __ref play_dead(void)
{
- idle_task_exit();
cpuhp_ap_report_dead();
/* flush data cache */
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index b01ebaa..51e68a4 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -804,7 +804,6 @@ void play_dead(void)
unsigned int cpu;
local_irq_disable();
- idle_task_exit();
cpu = smp_processor_id();
cpu_death = CPU_DEATH_POWER;
diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c
index e584299..73eca9c 100644
--- a/arch/mips/loongson64/smp.c
+++ b/arch/mips/loongson64/smp.c
@@ -766,7 +766,6 @@ void play_dead(void)
unsigned int cpu = smp_processor_id();
void (*play_dead_at_ckseg1)(int *);
- idle_task_exit();
cpuhp_ap_report_dead();
prid_imp = read_c0_prid() & PRID_IMP_MASK;
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 703644e..8606ecd 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -164,8 +164,6 @@ EXPORT_SYMBOL(running_on_qemu);
void __noreturn arch_cpu_idle_dead(void)
{
#ifdef CONFIG_HOTPLUG_CPU
- idle_task_exit();
-
local_irq_disable();
/* Tell the core that this CPU is now safe to dispose of. */
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 32fa5fb..9dc81e4 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -121,8 +121,6 @@ static void smp_85xx_cpu_offline_self(void)
/* mask all irqs to prevent cpu wakeup */
qoriq_pm_ops->irq_mask(cpu);
- idle_task_exit();
-
mtspr(SPRN_TCR, 0);
mtspr(SPRN_TSR, mfspr(SPRN_TSR));
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 88e92af..f8e674c 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -925,7 +925,6 @@ static void pmac_cpu_offline_self(void)
int cpu = smp_processor_id();
local_irq_disable();
- idle_task_exit();
pr_debug("CPU%d offline\n", cpu);
generic_set_cpu_dead(cpu);
smp_wmb();
@@ -940,7 +939,6 @@ static void pmac_cpu_offline_self(void)
int cpu = smp_processor_id();
local_irq_disable();
- idle_task_exit();
/*
* turn off as much as possible, we'll be
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index b1201db..9a480c9 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -172,7 +172,6 @@ static void pnv_cpu_offline_self(void)
/* Standard hot unplug procedure */
- idle_task_exit();
cpu = smp_processor_id();
DBG("CPU%d offline\n", cpu);
generic_set_cpu_dead(cpu);
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index bc6926d..1ade9a8 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -19,7 +19,6 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <linux/sched.h> /* for idle_task_exit */
#include <linux/sched/hotplug.h>
#include <linux/cpu.h>
#include <linux/of.h>
@@ -64,7 +63,6 @@ static void pseries_cpu_offline_self(void)
unsigned int hwcpu = hard_smp_processor_id();
local_irq_disable();
- idle_task_exit();
if (xive_enabled())
xive_teardown_cpu();
else
diff --git a/arch/powerpc/platforms/pseries/pmem.c b/arch/powerpc/platforms/pseries/pmem.c
index 0f1d45f..af48dfe 100644
--- a/arch/powerpc/platforms/pseries/pmem.c
+++ b/arch/powerpc/platforms/pseries/pmem.c
@@ -9,7 +9,6 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <linux/sched.h> /* for idle_task_exit */
#include <linux/sched/hotplug.h>
#include <linux/cpu.h>
#include <linux/of.h>
diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c
index 0bc56d8..3480431 100644
--- a/arch/riscv/kernel/cpu-hotplug.c
+++ b/arch/riscv/kernel/cpu-hotplug.c
@@ -66,8 +66,6 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
*/
void __noreturn arch_cpu_idle_dead(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
cpu_ops->cpu_stop();
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index f7c262a..aa574b8 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -918,7 +918,6 @@ void __cpu_die(unsigned int cpu)
void __noreturn cpu_die(void)
{
- idle_task_exit();
pcpu_sigp_retry(this_cpu_ptr(&pcpu_devices), SIGP_STOP, 0);
for (;;) ;
}
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 108d808..afd57bd 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -108,7 +108,6 @@ int native_cpu_disable(unsigned int cpu)
void play_dead_common(void)
{
- idle_task_exit();
irq_ctx_exit(raw_smp_processor_id());
mb();
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 371460e..e98b5dd 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1290,8 +1290,6 @@ void cpu_play_dead(void)
int cpu = smp_processor_id();
unsigned long pstate;
- idle_task_exit();
-
if (tlb_type == hypervisor) {
struct trap_per_cpu *tb = &trap_block[cpu];
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ba01a9e..dcbaf3f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1407,8 +1407,6 @@ int native_cpu_disable(void)
void play_dead_common(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
local_irq_disable();
diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c
index e4c25d0..094e1da 100644
--- a/arch/xtensa/kernel/smp.c
+++ b/arch/xtensa/kernel/smp.c
@@ -336,7 +336,6 @@ void __noreturn arch_cpu_idle_dead(void)
*/
void __ref cpu_die(void)
{
- idle_task_exit();
local_irq_disable();
__asm__ __volatile__(
" movi a2, cpu_restart\n"
diff --git a/include/linux/sched/hotplug.h b/include/linux/sched/hotplug.h
index 17e0485..18fa3e6 100644
--- a/include/linux/sched/hotplug.h
+++ b/include/linux/sched/hotplug.h
@@ -18,6 +18,4 @@ extern int sched_cpu_dying(unsigned int cpu);
# define sched_cpu_dying NULL
#endif
-static inline void idle_task_exit(void) {}
-
#endif /* _LINUX_SCHED_HOTPLUG_H */
^ permalink raw reply related [flat|nested] 8+ messages in thread* [tip: sched/core] sched/hotplug: Remove unused idle_task_exit
2026-10-16 9:56 [PATCH] sched/hotplug: Remove unused idle_task_exit Srikar Dronamraju
` (3 preceding siblings ...)
2026-11-09 9:28 ` tip-bot2 for Srikar Dronamraju
@ 2026-11-09 10:01 ` tip-bot2 for Srikar Dronamraju
4 siblings, 0 replies; 8+ messages in thread
From: tip-bot2 for Srikar Dronamraju @ 2026-11-09 10:01 UTC (permalink / raw)
To: linux-tip-commits
Cc: Srikar Dronamraju, Peter Zijlstra (Intel), Ingo Molnar,
Frederic Weisbecker, x86, linux-kernel
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 879ebf19774f8338fb27257c21d2bc94caae97d0
Gitweb: https://git.kernel.org/tip/879ebf19774f8338fb27257c21d2bc94caae97d0
Author: Srikar Dronamraju <srikar@linux.ibm.com>
AuthorDate: Fri, 16 Oct 2026 15:26:40 +05:30
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 09 Nov 2026 10:58:06 +01:00
sched/hotplug: Remove unused idle_task_exit
Commit 21641bd9a7a7 ("lazy tlb: fix hotplug exit race with
MMU_LAZY_TLB_SHOOTDOWN") moved the handling previously performed by
idle_task_exit() into the scheduler CPU hotplug path using
sched_force_init_mm().
As a result, idle_task_exit() is now an empty stub and the remaining
architecture call sites have no effect.
Remove the calls to idle_task_exit() and the now unused stub.
Signed-off-by: Srikar Dronamraju <srikar@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://patch.msgid.link/20261016095711.1364609-1-srikar@linux.ibm.com
---
arch/arm/kernel/smp.c | 2 --
arch/arm64/kernel/smp.c | 2 --
arch/csky/kernel/smp.c | 2 --
arch/loongarch/kernel/smp.c | 2 --
arch/mips/cavium-octeon/smp.c | 1 -
arch/mips/kernel/smp-bmips.c | 1 -
arch/mips/kernel/smp-cps.c | 1 -
arch/mips/loongson64/smp.c | 1 -
arch/parisc/kernel/process.c | 2 --
arch/powerpc/platforms/85xx/smp.c | 2 --
arch/powerpc/platforms/powermac/smp.c | 2 --
arch/powerpc/platforms/powernv/smp.c | 1 -
arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 --
arch/powerpc/platforms/pseries/pmem.c | 1 -
arch/riscv/kernel/cpu-hotplug.c | 2 --
arch/s390/kernel/smp.c | 1 -
arch/sh/kernel/smp.c | 1 -
arch/sparc/kernel/smp_64.c | 2 --
arch/x86/kernel/smpboot.c | 2 --
arch/xtensa/kernel/smp.c | 1 -
include/linux/sched/hotplug.h | 2 --
21 files changed, 33 deletions(-)
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index a9f4600..eed8c2c 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -319,8 +319,6 @@ void __noreturn arch_cpu_idle_dead(void)
{
unsigned int cpu = smp_processor_id();
- idle_task_exit();
-
local_irq_disable();
/*
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 014b163..48b425e 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -372,8 +372,6 @@ void __noreturn cpu_die(void)
unsigned int cpu = smp_processor_id();
const struct cpu_operations *ops = get_cpu_ops(cpu);
- idle_task_exit();
-
local_daif_mask();
/* Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose of */
diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c
index 92dbbf3..e6333cc 100644
--- a/arch/csky/kernel/smp.c
+++ b/arch/csky/kernel/smp.c
@@ -294,8 +294,6 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
void __noreturn arch_cpu_idle_dead(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
while (!secondary_stack)
diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c
index 11f5483..6b21af1 100644
--- a/arch/loongarch/kernel/smp.c
+++ b/arch/loongarch/kernel/smp.c
@@ -478,7 +478,6 @@ static void __noreturn idle_play_dead(void)
register uint64_t addr;
register void (*init_fn)(void);
- idle_task_exit();
local_irq_enable();
set_csr_ecfg(ECFGF_IPI);
__this_cpu_write(cpu_state, CPU_DEAD);
@@ -503,7 +502,6 @@ static void __noreturn poll_play_dead(void)
register uint64_t addr;
register void (*init_fn)(void);
- idle_task_exit();
__this_cpu_write(cpu_state, CPU_DEAD);
__smp_mb();
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index 054e331..0e557e7 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -344,7 +344,6 @@ void play_dead(void)
{
int cpu = cpu_number_map(cvmx_get_core_num());
- idle_task_exit();
cpuhp_ap_report_dead();
octeon_processor_boot = 0xff;
per_cpu(cpu_state, cpu) = CPU_DEAD;
diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
index 35b8d81..e4a523b 100644
--- a/arch/mips/kernel/smp-bmips.c
+++ b/arch/mips/kernel/smp-bmips.c
@@ -391,7 +391,6 @@ static void bmips_cpu_die(unsigned int cpu)
void __ref play_dead(void)
{
- idle_task_exit();
cpuhp_ap_report_dead();
/* flush data cache */
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index b01ebaa..51e68a4 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -804,7 +804,6 @@ void play_dead(void)
unsigned int cpu;
local_irq_disable();
- idle_task_exit();
cpu = smp_processor_id();
cpu_death = CPU_DEATH_POWER;
diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c
index e584299..73eca9c 100644
--- a/arch/mips/loongson64/smp.c
+++ b/arch/mips/loongson64/smp.c
@@ -766,7 +766,6 @@ void play_dead(void)
unsigned int cpu = smp_processor_id();
void (*play_dead_at_ckseg1)(int *);
- idle_task_exit();
cpuhp_ap_report_dead();
prid_imp = read_c0_prid() & PRID_IMP_MASK;
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 703644e..8606ecd 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -164,8 +164,6 @@ EXPORT_SYMBOL(running_on_qemu);
void __noreturn arch_cpu_idle_dead(void)
{
#ifdef CONFIG_HOTPLUG_CPU
- idle_task_exit();
-
local_irq_disable();
/* Tell the core that this CPU is now safe to dispose of. */
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 32fa5fb..9dc81e4 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -121,8 +121,6 @@ static void smp_85xx_cpu_offline_self(void)
/* mask all irqs to prevent cpu wakeup */
qoriq_pm_ops->irq_mask(cpu);
- idle_task_exit();
-
mtspr(SPRN_TCR, 0);
mtspr(SPRN_TSR, mfspr(SPRN_TSR));
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 88e92af..f8e674c 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -925,7 +925,6 @@ static void pmac_cpu_offline_self(void)
int cpu = smp_processor_id();
local_irq_disable();
- idle_task_exit();
pr_debug("CPU%d offline\n", cpu);
generic_set_cpu_dead(cpu);
smp_wmb();
@@ -940,7 +939,6 @@ static void pmac_cpu_offline_self(void)
int cpu = smp_processor_id();
local_irq_disable();
- idle_task_exit();
/*
* turn off as much as possible, we'll be
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index b1201db..9a480c9 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -172,7 +172,6 @@ static void pnv_cpu_offline_self(void)
/* Standard hot unplug procedure */
- idle_task_exit();
cpu = smp_processor_id();
DBG("CPU%d offline\n", cpu);
generic_set_cpu_dead(cpu);
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index bc6926d..1ade9a8 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -19,7 +19,6 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <linux/sched.h> /* for idle_task_exit */
#include <linux/sched/hotplug.h>
#include <linux/cpu.h>
#include <linux/of.h>
@@ -64,7 +63,6 @@ static void pseries_cpu_offline_self(void)
unsigned int hwcpu = hard_smp_processor_id();
local_irq_disable();
- idle_task_exit();
if (xive_enabled())
xive_teardown_cpu();
else
diff --git a/arch/powerpc/platforms/pseries/pmem.c b/arch/powerpc/platforms/pseries/pmem.c
index 0f1d45f..af48dfe 100644
--- a/arch/powerpc/platforms/pseries/pmem.c
+++ b/arch/powerpc/platforms/pseries/pmem.c
@@ -9,7 +9,6 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <linux/sched.h> /* for idle_task_exit */
#include <linux/sched/hotplug.h>
#include <linux/cpu.h>
#include <linux/of.h>
diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c
index 0bc56d8..3480431 100644
--- a/arch/riscv/kernel/cpu-hotplug.c
+++ b/arch/riscv/kernel/cpu-hotplug.c
@@ -66,8 +66,6 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
*/
void __noreturn arch_cpu_idle_dead(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
cpu_ops->cpu_stop();
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index f7c262a..aa574b8 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -918,7 +918,6 @@ void __cpu_die(unsigned int cpu)
void __noreturn cpu_die(void)
{
- idle_task_exit();
pcpu_sigp_retry(this_cpu_ptr(&pcpu_devices), SIGP_STOP, 0);
for (;;) ;
}
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 108d808..afd57bd 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -108,7 +108,6 @@ int native_cpu_disable(unsigned int cpu)
void play_dead_common(void)
{
- idle_task_exit();
irq_ctx_exit(raw_smp_processor_id());
mb();
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 371460e..e98b5dd 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1290,8 +1290,6 @@ void cpu_play_dead(void)
int cpu = smp_processor_id();
unsigned long pstate;
- idle_task_exit();
-
if (tlb_type == hypervisor) {
struct trap_per_cpu *tb = &trap_block[cpu];
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ba01a9e..dcbaf3f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1407,8 +1407,6 @@ int native_cpu_disable(void)
void play_dead_common(void)
{
- idle_task_exit();
-
cpuhp_ap_report_dead();
local_irq_disable();
diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c
index e4c25d0..094e1da 100644
--- a/arch/xtensa/kernel/smp.c
+++ b/arch/xtensa/kernel/smp.c
@@ -336,7 +336,6 @@ void __noreturn arch_cpu_idle_dead(void)
*/
void __ref cpu_die(void)
{
- idle_task_exit();
local_irq_disable();
__asm__ __volatile__(
" movi a2, cpu_restart\n"
diff --git a/include/linux/sched/hotplug.h b/include/linux/sched/hotplug.h
index 17e0485..18fa3e6 100644
--- a/include/linux/sched/hotplug.h
+++ b/include/linux/sched/hotplug.h
@@ -18,6 +18,4 @@ extern int sched_cpu_dying(unsigned int cpu);
# define sched_cpu_dying NULL
#endif
-static inline void idle_task_exit(void) {}
-
#endif /* _LINUX_SCHED_HOTPLUG_H */
^ permalink raw reply related [flat|nested] 8+ messages in thread