aboutsummaryrefslogtreecommitdiffstats
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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
index 157d9e31f6c2..c2f5b0f8cacd 100644
--- a/lib/smp_processor_id.c
+++ b/lib/smp_processor_id.c
@@ -23,7 +23,12 @@ unsigned int check_preemption_disabled(const char *what1, const char *what2)
* Kernel threads bound to a single CPU can safely use
* smp_processor_id():
*/
- if (cpumask_equal(&current->cpus_allowed, cpumask_of(this_cpu)))
+#if defined(CONFIG_PREEMPT_RT_BASE) && (defined(CONFIG_SMP) || defined(CONFIG_SCHED_DEBUG))
+ if (current->migrate_disable)
+ goto out;
+#endif
+
+ if (current->nr_cpus_allowed == 1)
goto out;
/*