Re: [PATCH] printk: restore flushing of NMI buffers on remote CPUs after NMI backtraces

From: Nicholas Piggin
Date: Mon Nov 08 2021 - 08:43:40 EST


Excerpts from Petr Mladek's message of November 8, 2021 6:34 pm:
> On Sun 2021-11-07 14:51:16, Nicholas Piggin wrote:
>> printk from NMI context relies on irq work being raised on the local CPU
>> to print to console. This can be a problem if the NMI was raised by a
>> lockup detector to print lockup stack and regs, because the CPU may not
>> enable irqs (because it is locked up).
>>
>> Introduce printk_trigger_flush() that can be called another CPU to try
>> to get those messages to the console, call that where printk_safe_flush
>> was previously called.
>>
>> Fixes: 93d102f094be ("printk: remove safe buffers")
>> Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
>
> Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>
>
> We should add also
>
> Cc: stable@xxxxxxxxxxxxxxx # 5.15
>
> No need to resent the patch. I could add it when pushing.
>
> Plan: I am going to wait one or more days for a potential feedback
> and ack from John. Then I am going to push this into printk/linux.git.

That sounds good to me.

> IMHO, it makes sense to get this into 5.16-rc1 or rc2.

Agree.

Thanks,
Nick

> Thank you both a lot for nailing this down and for the fix.
>
> Best Regards,
> Petr
>