[lkml]   [2005]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[RT] Race condition on bug output.
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

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

-- 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) \

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-12-07 04:37    [W:0.028 / U:23.892 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site