Skip to content

Commit

Permalink
powerpc/preempt: Don't touch the idle task's preempt_count during hot…
Browse files Browse the repository at this point in the history
…plug

commit 2c669ef upstream.

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 f1a0a37 ("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: f1a0a37 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Valentin Schneider authored and gregkh committed Jul 14, 2021
1 parent 9b07d81 commit bdf4d33
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions arch/powerpc/platforms/cell/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ static inline int smp_startup_cpu(unsigned int lcpu)

pcpu = get_hard_smp_processor_id(lcpu);

/* Fixup atomic count: it exited inside IRQ handler. */
task_thread_info(paca_ptrs[lcpu]->__current)->preempt_count = 0;

/*
* If the RTAS start-cpu token does not exist then presume the
* cpu is already spinning.
Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/platforms/pseries/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ static inline int smp_startup_cpu(unsigned int lcpu)
return 1;
}

/* Fixup atomic count: it exited inside IRQ handler. */
task_thread_info(paca_ptrs[lcpu]->__current)->preempt_count = 0;

/*
* If the RTAS start-cpu token does not exist then presume the
* cpu is already spinning.
Expand Down

0 comments on commit bdf4d33

Please sign in to comment.