lkml.org 
[lkml]   [2020]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH printk 4/5] printk: remove logbuf_lock, add syslog_lock
On (20/09/22 17:44), John Ogness wrote:
[..]
> void printk_safe_flush_on_panic(void)
> {
> - /*
> - * Make sure that we could access the main ring buffer.
> - * Do not risk a double release when more CPUs are up.
> - */
> - if (raw_spin_is_locked(&logbuf_lock)) {
> - if (num_online_cpus() > 1)
> - return;
> -
> - debug_locks_off();
> - raw_spin_lock_init(&logbuf_lock);

If we panic() with syslog_lock locked then we need to zap syslog_lock
and disable debug_locks for kmsg_dump() to succeed. Otherwise panic()
may deadlock:

syslog_lock_irq()
-> NMI
panic()
...
printk_safe_flush_on_panic();
kmsg_dump(KMSG_DUMP_PANIC); // syslog_lock_irqsave(flags)
...

Did I miss the point where we make sure that kmsg_dump() will not
deadlock?

-ss

\
 
 \ /
  Last update: 2020-09-24 10:46    [W:0.166 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site