Skip to content

Commit 4fa5cd5

Browse files
ckolivasingomolnar
authored andcommitted
sched/core: Do not use smp_processor_id() with preempt enabled in smpboot_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>
1 parent d59dc7b commit 4fa5cd5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/smpboot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ static int smpboot_thread_fn(void *data)
122122

123123
if (kthread_should_park()) {
124124
__set_current_state(TASK_RUNNING);
125-
preempt_enable();
126125
if (ht->park && td->status == HP_THREAD_ACTIVE) {
127126
BUG_ON(td->cpu != smp_processor_id());
128127
ht->park(td->cpu);
129128
td->status = HP_THREAD_PARKED;
130129
}
130+
preempt_enable();
131131
kthread_parkme();
132132
/* We might have been woken for stop */
133133
continue;

0 commit comments

Comments
 (0)