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:Petr Mladek <pmladek@suse.com> Signed-off-by:
Stephen Brennan <stephen.s.brennan@oracle.com> Reviewed-by:
Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by:
Petr 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:
Ye Weihua <yeweihua4@huawei.com>
Loading
Please sign in to comment