Skip to content
Commit be6a2e4c authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Revert "sched/core: Do not use smp_processor_id() with preempt enabled in smpboot_thread_fn()"



This reverts commit 4fa5cd52.

The original change widens a preempt-off section, to avoid a seemingly unsafe
smp_processor_id() use.

During review I overlooked two facts:

 - The code to calls a non-trivial function callback:

                                ht->park(td->cpu);

   ... which might (and does occasionally) sleep, triggering the warning.

 - More importantly, as pointed out by Peter Zijlstra, using
   smp_processor_id() in that context is safe, if it's done from
   a kernel thread that is pinned to a single CPU - which is the
   case here.

So revert to the original code that enables preemption sooner.

Reported-by: default avatarkernel test robot <xiaolong.ye@intel.com>
Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
Cc: Con Kolivas <kernel@kolivas.org>
Cc: Alfred Chen <cchalpha@gmail.com>
Link: http://lkml.kernel.org/r/20160930015102.GB20189@yexl-desktop


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 597f03f9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment