Re: [PATCH 1/1] powerpc/crash: Use NMI context for printk after crashing other CPUs
From: Leonardo Bras
Date: Wed Apr 08 2020 - 14:42:43 EST
On Wed, 2020-04-08 at 22:13 +1000, Michael Ellerman wrote:
[...]
> Added context:
>
> printk(KERN_EMERG "Sending IPI to other CPUs\n");
>
> if (crash_wake_offline)
> ncpus = num_present_cpus() - 1;
>
> >
> > crash_send_ipi(crash_ipi_callback);
> > smp_wmb();
> > + printk_nmi_enter();
>
> Why did you decide to put it there, rather than at the start of
> default_machine_crash_shutdown() like I did?
>
> The printk() above could have already deadlocked if another CPU is stuck
> with the logbuf lock held.
Oh, I thought the CPUs would start crashing after crash_send_ipi(), so
only printk() after that would possibly deadlock.
I was not able to see how the printk() above would deadlock, but I see
no problem adding that at the start of the function.
Best regards,
Leonardo Bras
Attachment:
signature.asc
Description: This is a digitally signed message part