Re: [debug patch] printk: Add a printk killswitch to robustify NMIwatchdog messages

From: Arne Jansen
Date: Mon Jun 06 2011 - 13:58:01 EST


On 06.06.2011 19:11, Ingo Molnar wrote:

* Peter Zijlstra<peterz@xxxxxxxxxxxxx> wrote:


+void printk_tick(void)
+{
+ if (!__this_cpu_read(printk_pending))
+ return;
+
+ /*
+ * Try to acquire and then immediately release the
+ * console semaphore. The release will do all the
+ * actual magic (print out buffers, wake up klogd,
+ * etc).
+ */
+ if (console_trylock_for_printk(smp_processor_id())) {
+ console_unlock();
+ __this_cpu_write(printk_pending, 0);
+ }
+}

Arne does this fix the hang you are seeing?

What do you want me to test? just replace printk_tick with the
above version? If I do that, the machine doesn't even boot up
any more.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/