lkml.org 
[lkml]   [2018]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] printk/nmi: Prevent deadlock when serializing NMI backtraces
On (05/22/18 17:43), Steven Rostedt wrote:
> > CPU0 CPU1 CPU2
> >
> > printk()
> > vprintk_emit()
> > spin_lock(&logbuf_lock)
> >
> > trigger_all_cpu_backtrace()
> > raise()
> >
> > nmi_enter()
> > printk_nmi_enter()
> > if (this_cpu_read(printk_context)
> > & PRINTK_SAFE_CONTEXT_MASK)
> > // false
> > else
> > // looks safe to use printk_deferred()
> > this_cpu_or(printk_context,
> > PRINTK_NMI_DEFERRED_CONTEXT_MASK);
> >
> > nmi_cpu_backtrace()
> > arch_spin_lock(&lock);
>
> What branch is this based on, because I can't find the
> "arch_spin_lock()" you are talking about here.

This arch_spin_lock() is in lib/nmi_backtrace.c

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/nmi_backtrace.c?h=v4.17-rc6#n94

-ss

\
 
 \ /
  Last update: 2018-05-23 04:01    [W:0.320 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site