kernel/lib/smp_processor_id.c
.. .. @@ -22,7 +22,12 @@ 22 22 * Kernel threads bound to a single CPU can safely use 23 23 * smp_processor_id(): 24 24 */ 25 - if (cpumask_equal(¤t->cpus_allowed, cpumask_of(this_cpu)))25 +#if defined(CONFIG_PREEMPT_RT_BASE) && (defined(CONFIG_SMP) || defined(CONFIG_SCHED_DEBUG))26 + if (current->migrate_disable)27 + goto out;28 +#endif29 +30 + if (current->nr_cpus_allowed == 1)26 31 goto out; 27 32 28 33 /*