Re: [debug patch] printk: Add a printk killswitch to robustify NMIwatchdog messages
From: Ingo Molnar
Date: Mon Jun 06 2011 - 09:22:14 EST
* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Mon, 2011-06-06 at 15:10 +0200, Ingo Molnar wrote:
>
>
> > diff --git a/kernel/printk.c b/kernel/printk.c
> > index 3518539..1b9d2be 100644
> > --- a/kernel/printk.c
> > +++ b/kernel/printk.c
> > @@ -859,7 +859,6 @@ asmlinkage int vprintk(const char *fmt, va_list args)
> > zap_locks();
> > }
> >
> > - lockdep_off();
>
> At the very least you should also do: s/raw_local_irq_/local_irq/ on
> this function.
Right, i've also removed the preempt_disable()/enable() pair - that
looks superfluous.
Updated patch below - still untested.
Thanks,
Ingo
---
kernel/printk.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
Index: tip/kernel/printk.c
===================================================================
--- tip.orig/kernel/printk.c
+++ tip/kernel/printk.c
@@ -836,9 +836,8 @@ asmlinkage int vprintk(const char *fmt,
boot_delay_msec();
printk_delay();
- preempt_disable();
/* This stops the holder of console_sem just where we want him */
- raw_local_irq_save(flags);
+ local_irq_save(flags);
this_cpu = smp_processor_id();
/*
@@ -859,7 +858,6 @@ asmlinkage int vprintk(const char *fmt,
zap_locks();
}
- lockdep_off();
spin_lock(&logbuf_lock);
printk_cpu = this_cpu;
@@ -947,7 +945,7 @@ asmlinkage int vprintk(const char *fmt,
* 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).
+ * etc).
*
* The console_trylock_for_printk() function
* will release 'logbuf_lock' regardless of whether it
@@ -956,11 +954,9 @@ asmlinkage int vprintk(const char *fmt,
if (console_trylock_for_printk(this_cpu))
console_unlock();
- lockdep_on();
out_restore_irqs:
- raw_local_irq_restore(flags);
+ local_irq_restore(flags);
- preempt_enable();
return printed_len;
}
EXPORT_SYMBOL(printk);
--
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/