summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCon Kolivas <kernel@kolivas.org>2016-09-13 08:27:05 +0200
committerIngo Molnar <mingo@kernel.org>2016-09-22 12:28:00 +0200
commit4fa5cd5245b627db88c9ca08ae442373b02596b4 (patch)
treeaecd2b67c67aa25caf9b3691e50cd7bac91900dc
parentsched/numa, mm: Revert to checking pmd/pte_write instead of VMA flags (diff)
downloadlinux-4fa5cd5245b627db88c9ca08ae442373b02596b4.tar.xz
linux-4fa5cd5245b627db88c9ca08ae442373b02596b4.zip
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>
-rw-r--r--kernel/smpboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index 13bc43d1fb22..fc0d8270f69e 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -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;