mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	john stultz <johnstul@us.ibm.com>
Subject: [RT] Race condition on bug output.
Date: Tue, 06 Dec 2005 22:34:53 -0500	[thread overview]
Message-ID: <1133926493.6724.109.camel@localhost.localdomain> (raw)

Hi Ingo,

I found a race condition in my kernel which can also be found in yours.
When I trigger the printk in check_periodic_interval, interrupts are
turned on in release_console_sem.  Unfortunately, this can have an
interrupt go off there (since they are turned back on there) and the
write_lock system_time_lock will be taken again, thus producing a
deadlock.

I'm not sure if this is the best solution, but this was the easiest.

Maybe the CONFIG_PARANOID_GENERIC_TIME should be added in the warnings
in init/main.c too?

Since interrupts are kept off in the ktimer (hrtimer, whatever) in
printk, this does not affect those patches.  This is a PREEMPT_RT only
problem.

-- Steve

Index: linux-2.6.14-rt22/kernel/printk.c
===================================================================
--- linux-2.6.14-rt22.orig/kernel/printk.c	2005-12-06 21:44:53.000000000 -0500
+++ linux-2.6.14-rt22/kernel/printk.c	2005-12-06 21:52:11.000000000 -0500
@@ -757,7 +757,8 @@
 		 * on PREEMPT_RT, call console drivers with
 		 * interrupts enabled (unless we are debugging):
 		 */
-#if defined(CONFIG_PREEMPT_RT) && !defined(CONFIG_PRINTK_IGNORE_LOGLEVEL) && !defined(CONFIG_PPC)
+#if defined(CONFIG_PREEMPT_RT) && !defined(CONFIG_PRINTK_IGNORE_LOGLEVEL) && !defined(CONFIG_PPC) \
+    && !defined(CONFIG_PARANOID_GENERIC_TIME)
 		spin_unlock_irq(&logbuf_lock);
 #else
 		spin_unlock(&logbuf_lock);



             reply	other threads:[~2005-12-07  3:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-07  3:34 Steven Rostedt [this message]
2005-12-07  8:33 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1133926493.6724.109.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®