linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib: Check for migrate_disable only on SMP systems
@ 2019-12-06 14:21 Daniel Wagner
  2019-12-06 18:49 ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Wagner @ 2019-12-06 14:21 UTC (permalink / raw)
  To: linux-rt-users; +Cc: Daniel Wagner, Scott Wood, Sebastian Andrzej Siewior

In case the kernel configuration is UP is, the migrate_disable member
in task_struct is missing.

linux/lib/smp_processor_id.c: In function ‘check_preemption_disabled’:
linux/lib/smp_processor_id.c:26:13: error: ‘struct task_struct’ has no member named ‘migrate_disable’
    26 |  if (current->migrate_disable)
       |             ^~

Fixes: 425c5b38779a ("sched: Lazy migrate_disable processing")
Cc: Scott Wood <swood@redhat.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 lib/smp_processor_id.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
index 5f2618d346c4..a914f73e3652 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_SMP) && defined(CONFIG_PREEMPT_RT_BASE)
 	if (current->migrate_disable)
 		goto out;
+#endif
 
 	if (current->nr_cpus_allowed == 1)
 		goto out;
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-12-16 17:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 14:21 [PATCH] lib: Check for migrate_disable only on SMP systems Daniel Wagner
2019-12-06 18:49 ` Scott Wood
2019-12-06 19:39   ` Daniel Wagner
2019-12-07  3:21     ` Scott Wood
2019-12-09 10:04       ` Daniel Wagner
2019-12-10  0:40         ` Scott Wood
2019-12-16 15:21           ` [PATCH RT] " Sebastian Andrzej Siewior
2019-12-16 17:06             ` Scott Wood
2019-12-16 17:09               ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).