lkml.org 
[lkml]   [2011]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [debug patch] printk: Add a printk killswitch to robustify NMI watchdog messages

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Mon, 2011-06-06 at 17:52 +0200, Ingo Molnar wrote:
> > * Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > > Needs more staring at, preferably by someone who actually
> > > understands that horrid mess :/ Also, this all still doesn't make
> > > printk() work reliably while holding rq->lock.
> >
> > So, what about my suggestion to just *remove* the wakeup from there
> > and use the deferred wakeup mechanism that klogd uses.
> >
> > That would make printk() *visibly* more robust in practice.
>
> That's currently done from the jiffy tick, do you want to effectively
> delay releasing the console_sem for the better part of a jiffy?

Yes, and we already do it in some other circumstances. Can you see
any problem with that? klogd is an utter slowpath anyway.

> > [ It would also open up the way to possibly make printk() NMI entry
> > safe - currently we lock up if we printk in an NMI or #MC context
> > that happens to nest inside a printk(). ]
>
> Well, for that to happen you also need to deal with logbuf_lock
> nesting. [...]

That we could do as a robustness patch: detect when the current CPU
already holds it and do not lock up on that. This would also allow
printk() to work within a crashing printk(). (assuming the second
printk() does not crash - in which case it's game over anyway)

> Personally I think using printk() from NMI context is quite beyond
> sane.

Yeah, quite so, but it *can* happen so if we can make it work as a
free side-effect of a printk()-robustness increasing patch, why not?

Thanks,

Ingo


\
 
 \ /
  Last update: 2011-06-06 18:11    [W:0.107 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site