summaryrefslogtreecommitdiff
path: root/lib/smp_processor_id.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smp_processor_id.c')
-rw-r--r--lib/smp_processor_id.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
index 525222e4f409..94b3f6b19538 100644
--- a/lib/smp_processor_id.c
+++ b/lib/smp_processor_id.c
@@ -19,11 +19,10 @@ unsigned int check_preemption_disabled(const char *what1, const char *what2)
if (irqs_disabled())
goto out;
- /*
- * Kernel threads bound to a single CPU can safely use
- * smp_processor_id():
- */
- if (current->nr_cpus_allowed == 1)
+ if (is_percpu_thread())
+ goto out;
+
+ if (current->migration_disabled)
goto out;
/*
@@ -46,9 +45,9 @@ unsigned int check_preemption_disabled(const char *what1, const char *what2)
printk("caller is %pS\n", __builtin_return_address(0));
dump_stack();
- instrumentation_end();
out_enable:
+ instrumentation_end();
preempt_enable_no_resched_notrace();
out:
return this_cpu;