Commit 8068817f authored by Stephen Brennan's avatar Stephen Brennan Committed by Ye Weihua
Browse files

printk: Avoid livelock with heavy printk during panic

mainline inclusion
from mainline-v5.18-rc1
commit 13fb0f74
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I89RYC
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=13fb0f74d7029df3b8137f11ef955e578a4a4a60



-------------------------------------------------

During panic(), if another CPU is writing heavily the kernel log (e.g.
via /dev/kmsg), then the panic CPU may livelock writing out its messages
to the console. Note when too many messages are dropped during panic and
suppress further printk, except from the panic CPU. This could result in
some important messages being dropped. However, messages are already
being dropped, so this approach at least prevents a livelock.

Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Signed-off-by: default avatarStephen Brennan <stephen.s.brennan@oracle.com>
Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20220202171821.179394-4-stephen.s.brennan@oracle.com



Conflict:
	kernel/printk/printk.c

Signed-off-by: default avatarYe Weihua <yeweihua4@huawei.com>
parent bf98822e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment