Re: [PATCH v2] debugobjects: Move printk out of db lock critical sections

From: Thomas Gleixner
Date: Tue Dec 18 2018 - 09:06:21 EST


On Tue, 18 Dec 2018, Ingo Molnar wrote:
> * Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> > So thinking that early_printk is any better is just puting your head in
> > the sand.
>
> ... at my own feet. ;-) Apologies to the syslog folks!
>
> early_printk should still in principle be more robust: it tries to use as
> little (no) locking as possible, and definitely tries to do no
> allocations. It doesn't use syslog, nor any console locking, nor any
> regular console drivers.
>
> Which results in usability trade-offs: trashed screen output, mangled
> lines. It's a superior debug facility when debugging particularly hairy
> low level code - which most of the kernel isn't where it turns into an
> inferior debugging method.
>
> I thing a good solution would be PeterZ's force_early_printk boot knob,
> for those low level folks who absolutely want to rely on printk always
> working in some fashion.
>
> ( I think it might even be possible to add a non-locked feature to
> early-printk that actually adds the messages to the syslog ring-buffer
> - without any notification/wakeup/serialization features. 'dmesg' is
> handy and its lack is the primary usability disadvantage of
> earlyprintk. )

There is work in progress on that... Should be in your inbox early next
year.

Thanks,

tglx