Commit bc085b2b authored by Philippe Gerum's avatar Philippe Gerum

lib/smp_processor_id: ipipe: exclude head domain from preemption check

There can be no CPU migration from the head stage, however the
out-of-band code currently running smp_processor_id() might have
preempted the regular kernel code from within a preemptible section,
which might cause false positive in the end.

These are the two reasons why we certainly neither need nor want to do
the preemption check in that case.
parent 43381d19
......@@ -6,12 +6,19 @@
*/
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/ipipe.h>
notrace static unsigned int check_preemption_disabled(const char *what1,
const char *what2)
{
int this_cpu = raw_smp_processor_id();
if (hard_irqs_disabled())
goto out;
if (!ipipe_root_p)
goto out;
if (likely(preempt_count()))
goto out;
......
Markdown is supported
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