[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190918023654.GB15380@jagdpanzerIV>
Date: Wed, 18 Sep 2019 11:36:54 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
John Ogness <john.ogness@...utronix.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Petr Mladek <pmladek@...e.com>,
Andrea Parri <parri.andrea@...il.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Brendan Higgins <brendanhiggins@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Theodore Ts'o <tytso@....edu>, Paul Turner <pjt@...gle.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Prarit Bhargava <prarit@...hat.com>
Subject: Re: printk meeting at LPC
On (09/17/19 22:08), Steven Rostedt wrote:
> > On (09/13/19 15:26), John Ogness wrote:
> > > 2. A kernel thread will be created for each registered console, each
> > > responsible for being the sole printers to their respective
> > > consoles. With this, console printing is _fully_ decoupled from printk()
> > > callers.
> >
> > sysrq over serial?
> >
> > What we currently have is hacky, but, as usual, is a "best effort":
> >
> > >> serial driver IRQ
> >
> > serial_handle_irq() [console driver]
> > uart_handle_sysrq_char()
> > handle_sysrq()
> > printk()
> > call_console_drivers()
> > serial_write() [re-enter console driver]
> >
> > offloading this to kthread may be unreliable.
>
> But we also talked about an "emergency flush" which will not wait for
> the kthreads to finish and just output everything it can find in the
> printk buffers (expecting that the consoles have an "emergency"
> handler. We can add a sysrq to do an emergency flush.
I'm sorry, I wasn't there, so I'm surely is missing on some details.
I agree that when consoles have ->atomic_write then it surely makes sense
to switch to emergency mode. I like the emergency state approach, but I'm
not sure how it can be completely invisible to the rest of the system.
Quoting John:
: Unlike oops_in_progress, this state will not be visible to
: anything outside of the printk infrastructure.
For instance, tty/sysrq must be able to switch printk emergency on/off.
That already means that printk emergency knob should be visible to the
rest of the kernel. A long time ago, we had printk_emergency_begin_sync()
and printk_emergency_end_sync(), which would define reentrable
printk_emergency blocks [1]:
printk_emergency_begin_sync();
handle_sysrq();
printk_emergency_end_sync();
We also figured out that some PM (hibernation/suspend/etc.) stages (very
early and/or very late ones) [2] also should have printk in emergency mode,
plus some other parts of the kernel [3].
[1] https://lore.kernel.org/lkml/20170815025625.1977-4-sergey.senozhatsky@gmail.com/
[2] https://lore.kernel.org/lkml/20170815025625.1977-7-sergey.senozhatsky@gmail.com/
[3] https://lore.kernel.org/lkml/20170815025625.1977-8-sergey.senozhatsky@gmail.com/
-ss
Powered by blists - more mailing lists