]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
printk: Avoid non-panic CPUs writing to ringbuffer
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 7 Feb 2024 13:41:01 +0000 (14:47 +0106)
committerPetr Mladek <pmladek@suse.com>
Wed, 7 Feb 2024 16:23:19 +0000 (17:23 +0100)
commit779dbc2e78d746250f07c463e13ac603b349f6f3
treedd2f54cab2002b327d2ec039f54bc9a56879e20e
parentd04d5882cd678b898a9d7c5aee6afbe9e6e77fcd
printk: Avoid non-panic CPUs writing to ringbuffer

Commit 13fb0f74d702 ("printk: Avoid livelock with heavy printk
during panic") introduced a mechanism to silence non-panic CPUs
if too many messages are being dropped. Aside from trying to
workaround the livelock bugs of legacy consoles, it was also
intended to avoid losing panic messages. However, if non-panic
CPUs are writing to the ringbuffer, then reacting to dropped
messages is too late.

Another motivation is that non-finalized messages already might
be skipped in panic(). In other words, random messages from
non-panic CPUs might already get lost. It is better to ignore
all to avoid confusion.

To avoid losing panic CPU messages, silence non-panic CPUs
immediately on panic.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240207134103.1357162-13-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
kernel/printk/printk.c