Re: [BUG] 8e274732115f ("printk: extend console_lock for per-console locking")

From: Petr Mladek
Date: Mon Jun 13 2022 - 07:50:12 EST


On Fri 2022-06-10 13:50:38, Paul E. McKenney wrote:
> Hello, John,
>
> I have started getting rcutorture shutdown-time hangs when running
> against recent mainline, and bisected back to the 8e274732115f ("printk:
> extend console_lock for per-console locking") commit. These hangs go
> away (or at least their probability drops dramatically) if I build with
> CONFIG_PREEMPTION=n -and- CONFIG_NO_HZ=y (not n!), at least assuming
> that I also boot with "nohz_full=0-N".

This means that the kthreads are probably more often sleeping with
con->lock when the pre-emtion is done by regular ticks.

We might want to wake them if we could call pr_flush().
But we could not do this in the generic panic() path.
It might cause deadlock when panic() is called from
scheduler code.

Pest Regards,
Petr