[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180523020107.GA8465@jagdpanzerIV>
Date: Wed, 23 May 2018 11:01:07 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
linux-kernel@...r.kernel.org, "4 . 13+" <stable@...r.kernel.org>
Subject: Re: [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
Powered by blists - more mailing lists