Skip to content

Commit

Permalink
sched/core: Do not use smp_processor_id() with preempt enabled in smp…
Browse files Browse the repository at this point in the history
…boot_thread_fn()

We should not be using smp_processor_id() with preempt enabled.

Bug identified and fix provided by Alfred Chen.

Reported-by: Alfred Chen <cchalpha@gmail.com>
Signed-off-by: Con Kolivas <kernel@kolivas.org>
Cc: Alfred Chen <cchalpha@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/2042051.3vvUWIM0vs@hex
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Con Kolivas authored and Ingo Molnar committed Sep 22, 2016
1 parent d59dc7b commit 4fa5cd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ static int smpboot_thread_fn(void *data)

if (kthread_should_park()) {
__set_current_state(TASK_RUNNING);
preempt_enable();
if (ht->park && td->status == HP_THREAD_ACTIVE) {
BUG_ON(td->cpu != smp_processor_id());
ht->park(td->cpu);
td->status = HP_THREAD_PARKED;
}
preempt_enable();
kthread_parkme();
/* We might have been woken for stop */
continue;
Expand Down

0 comments on commit 4fa5cd5

Please sign in to comment.