Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/preempt: Don't touch the idle task's preempt_count during hotplug

Powerpc currently resets a CPU's idle task preempt_count to 0 before
said task starts executing the secondary startup routine (and becomes an
idle task proper).

This conflicts with commit f1a0a376ca0c ("sched/core: Initialize the
idle task with preemption disabled").

which initializes all of the idle tasks' preempt_count to
PREEMPT_DISABLED during smp_init(). Note that this was superfluous
before said commit, as back then the hotplug machinery would invoke
init_idle() via idle_thread_get(), which would have already reset the
CPU's idle task's preempt_count to PREEMPT_ENABLED.

Get rid of this preempt_count write.

Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled")
Reported-by: Bharata B Rao <bharata@linux.ibm.com>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Bharata B Rao <bharata@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210707183831.2106509-1-valentin.schneider@arm.com

authored by

Valentin Schneider and committed by
Michael Ellerman
2c669ef6 1df3af6d

-6
-3
arch/powerpc/platforms/cell/smp.c
··· 78 78 79 79 pcpu = get_hard_smp_processor_id(lcpu); 80 80 81 - /* Fixup atomic count: it exited inside IRQ handler. */ 82 - task_thread_info(paca_ptrs[lcpu]->__current)->preempt_count = 0; 83 - 84 81 /* 85 82 * If the RTAS start-cpu token does not exist then presume the 86 83 * cpu is already spinning.
-3
arch/powerpc/platforms/pseries/smp.c
··· 105 105 return 1; 106 106 } 107 107 108 - /* Fixup atomic count: it exited inside IRQ handler. */ 109 - task_thread_info(paca_ptrs[lcpu]->__current)->preempt_count = 0; 110 - 111 108 /* 112 109 * If the RTAS start-cpu token does not exist then presume the 113 110 * cpu is already spinning.