Skip to content

Commit 4fa5cd5

Browse files
ckolivasIngo Molnar
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 <[email protected]> Signed-off-by: Con Kolivas <[email protected]> Cc: Alfred Chen <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/2042051.3vvUWIM0vs@hex Signed-off-by: Ingo Molnar <[email protected]>
1 parent d59dc7b commit 4fa5cd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)