[PATCH 1/1] powerpc/crash: Use NMI context for printk after crashing other CPUs

Leonardo Bras leonardo at linux.ibm.com
Thu Apr 9 04:41:37 AEST 2020


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20200408/0038b3ad/attachment.sig>


More information about the Linuxppc-dev mailing list