Re: [PATCH printk v7 29/35] printk: Coordinate direct printing in panic
From: Petr Mladek
Date: Tue Aug 06 2024 - 05:59:48 EST
Hi Linus,
On Sun 2024-08-04 02:57:32, John Ogness wrote:
> If legacy and nbcon consoles are registered and the nbcon
> consoles are allowed to flush (i.e. no boot consoles
> registered), the legacy consoles will no longer perform
> direct printing on the panic CPU until after the backtrace
> has been stored. This will give the safe nbcon consoles a
> chance to print the panic messages before allowing the
> unsafe legacy consoles to print.
>
> If no nbcon consoles are registered or they are not allowed
> to flush, there is no change in behavior (i.e. legacy
> consoles will always attempt to print from the printk()
> caller context).
I want to be sure that this is acceptable to you.
This behavior has already been in the rejected pull request
for 6.11, see https://lore.kernel.org/r/Zp-_7R49fIHgIhaq@xxxxxxxxxxxxxxx
You did not complain about this particular change. But it is
yet another buffering in critical situation which you do not
like in general.
It is a bit different from the buffering during Oops. In this case,
the new nbcon consoles will still be flushed immediately. And
the legacy consoles will be blocked only when there is a nbcon
console.
The buffering here should increase the chance to see the messages
on the more safe (nbcon) consoles. The legacy consoles are less
safe primary because of the bust_spinlocks(1) called earlier.
I personally do not have strong opinion. The change makes sense.
It looks like it should make more good than harm. But it is not
a clear win.
Best Regards,
Petr