Re: consoles: was: [PATCH next v2 3/3] printk: remove logbuf_lock, add syslog_lock

From: Sergey Senozhatsky
Date: Tue Dec 08 2020 - 15:52:30 EST


On (20/12/07 10:50), Petr Mladek wrote:
[..]
> > and then some call into the scheduler
> > (or other kernel core functions) under semaphore's spin_lock.
> > For instance
> >
> > up()
> > raw_spin_lock_irqsave(&sem->lock)
> > __up()
> > wake_up_process()
> > try_to_wake_up()
>
> This problem is partly solved by printk_deferred(). In each
> case, printk_safe() does not help here.

printk_deferred() has never been used in all the critical code paths.
So I think printk_safe does help here; it takes care of all the
remaining cases, that are not "partly solved by printk_deferred()".

> I still do _not_ see a reason to keep printk_safe()!

Not sure I'm following, sorry. To put it simply - we better keep
printk_safe until "new recursion prevention" >= printk_safe().
In this patch set "new recursion prevention" < printk_safe().

-ss