From: Daniel Wagner <[email protected]>

commit af3c1c5fdf177870fb5e6e16b24e374696ab28f5 in linux-rt-devel.

The current->migrate_disable counter is not always defined leading to
build failures with DEBUG_PREEMPT && !PREEMPT_RT_BASE.

Restrict the access to ->migrate_disable to same set where
->migrate_disable is modified.

Signed-off-by: Daniel Wagner <[email protected]>
[bigeasy: adjust condition + description]
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Paul Gortmaker <[email protected]>

diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
index 5f2618d346c4..c2f5b0f8cacd 100644
--- a/lib/smp_processor_id.c
+++ b/lib/smp_processor_id.c
@@ -23,8 +23,10 @@ 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 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;
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8686): 
https://lists.yoctoproject.org/g/linux-yocto/message/8686
Mute This Topic: https://lists.yoctoproject.org/mt/74330120/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to