Re: [RFC PATCH v1] panic: Flush unsafe consoles before panic reboot
From: Breno Leitao
Date: Wed Oct 28 2026 - 17:15:37 EST
On Wed, Oct 28, 2026 at 03:43:42PM +0106, John Ogness wrote:
> On 2026-10-28, Breno Leitao <leitao@xxxxxxxxxx> wrote:
> >> For consoles with CON_NBCON_ATOMIC_UNSAFE, the default would be
> >> unsafe_panic:0. Otherwise the default would be unsafe_panic:1.
> >
> > How do you plan to use 'unsafe_panic' order exactly?
>
> Currently at the end of panic() an unsafe flush occurs by simply
> iterating through the list of consoles. That list ordering does have a
> fixed algorithm behind it, but it is quite hard to follow.
But is that flush invoked at all on the kdump/kexec path?
As far as I can see, nbcon_atomic_flush_unsafe() has a single caller,
at the very end of vpanic(). So the unsafe consoles are only flushed in
one specific "kernel ending" case: panic() with panic_timeout=0 and no
crash kernel loaded.
I think we are mixing two different topics here:
1) How to set the order of the unsafe flush (per console, from the
cmdline and/or sysfs).
2) A hook at the "kernel ending" sites (the panic reboot path,
__crash_kexec(), ...), so we do not forget to flush the unsafe
consoles there.
Should we split them?
The missing hook in 2) is what drops the netconsole panic output today,
while 1) is policy on top of it.
Thanks for the suggestions,
--breno