Re: [PATCH] MIPS: Fix arch_trigger_cpumask_backtrace()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Huacai,

On Mon, Feb 05, 2018 at 11:42:47AM +0800, Huacai Chen wrote:
> SysRq-L and RCU stall detector call arch_trigger_cpumask_backtrace() to
> trigger other CPU's backtrace, but its behavior is totally broken. The
> root cause is arch_trigger_cpumask_backtrace() use call-function IPI in
> irq context, which trigger deadlocks in smp_call_function_single() and
> smp_call_function_many().
> 
> This patch fix arch_trigger_cpumask_backtrace() by:
> 1, Use a dedecated IPI (SMP_CPU_BACKTRACE) to trigger backtraces;
> 2, If myself is in target cpumask, do backtrace and clear myself;
> 3, Use a spinlock to avoid parallel backtrace output;
> 4, Handle SMP_CPU_BACKTRACE IPI for Loongson-3.
> 
> I have attempted to implement SMP_CPU_BACKTRACE for all MIPS CPUs, but I
> failed because some of their IPIs are not extensible. :(

Interesting - I've been using a similar patch internally for a little
while which can be seen here:

  https://git.linux-mips.org/cgit/linux-mti.git/commit/?h=eng-v4.15&id=f46720d62919a0e99d2505f022efdae9a9518191

Mine uses the generic nmi_trigger_cpumask_backtrace() infrastructure to
handle most of the work, and just has to deal with sending the IPIs. It
relies upon some changes from Matt to do that for the generic platform.

If you have a chance could you test the branch below & let me know
whether it works for you?

  git://git.kernel.org/pub/scm/linux/kernel/git/paulburton/linux.git

  Branch "wip-cpumask-backtrace".

Hopefully with a little more work we can fix this up generically.

Thanks,
    Paul




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux