All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RT] printk: Shortcut out of waiter spinning on PREEMPT_RT
@ 2019-01-15 17:39 Steven Rostedt
  2019-01-15 18:54 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2019-01-15 17:39 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, Thomas Gleixner
  Cc: LKML, linux-rt-users, Petr Mladek, Sergey Senozhatsky

From: Steven Rostedt (VMware) <rostedt@goodmis.org>

As the consoles are written with preemption enabled in PREEMPT_RT, we
must not have any task spinning waiting on them. Currently, the code
that would make the task spin is #ifdef out when PREEMPT_RT is
enabled, but why go through grabbing of the locks to see if an owner is
set, when it never will be?

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index a43d07d4e043..1a61132deec1 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1742,6 +1742,13 @@ static int console_trylock_spinning(void)
 	if (console_trylock())
 		return 1;
 
+	/*
+	 * The consoles are preemptable in PREEMPT_RT, which can cause
+	 * spinning to deadlock.
+	 */
+	if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
+		return 0;
+
 	printk_safe_enter_irqsave(flags);
 
 	raw_spin_lock(&console_owner_lock);

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 17:39 [PATCH RT] printk: Shortcut out of waiter spinning on PREEMPT_RT Steven Rostedt
2019-01-15 18:54 ` Sebastian Andrzej Siewior
2019-01-15 19:58   ` Steven Rostedt
2019-01-16 10:07     ` Petr Mladek
2019-01-16 11:43       ` Sergey Senozhatsky
2019-01-16 12:27         ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.