[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YGxDXBJAolBCtojY@alley>
Date: Tue, 6 Apr 2021 13:17:48 +0200
From: Petr Mladek <pmladek@...e.com>
To: Sergey Senozhatsky <senozhatsky@...omium.org>
Cc: John Ogness <john.ogness@...utronix.de>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Eric Biederman <ebiederm@...ssion.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Nicholas Piggin <npiggin@...il.com>,
Alistair Popple <alistair@...ple.id.au>,
Jordan Niethe <jniethe5@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Tiezhu Yang <yangtiezhu@...ngson.cn>,
Alexey Kardashevskiy <aik@...abs.ru>,
Yue Hu <huyue2@...ong.com>, Rafael Aquini <aquini@...hat.com>,
"Guilherme G. Piccoli" <gpiccoli@...onical.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
linuxppc-dev@...ts.ozlabs.org, kexec@...ts.infradead.org
Subject: Re: [PATCH printk v2 2/5] printk: remove safe buffers
On Fri 2021-04-02 11:14:18, Sergey Senozhatsky wrote:
> On (21/04/01 16:17), Petr Mladek wrote:
> > > For the long term, we should introduce a printk-context API that allows
> > > callers to perfectly pack their multi-line output into a single
> > > entry. We discussed [0][1] this back in August 2020.
> >
> > We need a "short" term solution. There are currently 3 solutions:
> >
> > 1. Keep nmi_safe() and all the hacks around.
> >
> > 2. Serialize nmi_cpu_backtrace() by a spin lock and later by
> > the special lock used also by atomic consoles.
> >
> > 3. Tell complaining people how to sort the messed logs.
>
> Are we talking about nmi_cpu_backtrace()->dump_stack() or some
> other path?
It is about serializing
if (regs)
show_regs(regs);
else
dump_stack();
in nmi_cpu_backtrace() when it is triggered on many(all) CPUs
at the same time.
> dump_stack() seems to be already serialized by `dump_lock`. Hmm,
> show_regs() is not serialized, seems like it should be under the
> same `dump_lock` as dump_stack().
Ah, I think that you already mentioned it in the past and I forget it.
Yes, we would need to synchronize all these dump/show functions using
the same lock. It is already the lock that might be taken recursively
on the same CPU.
In each case, we must not introduce another lock in
nmi_cpu_backtrace() because it might cause deadlock with
@dump_lock.
Anyway, I would really like to keep the dumps serialized. So, we
either need to use the same lock everywhere or we need to keep
nmi_safe buffers for now.
I would like to remove the nmi_safe buffers in the long term
but I am fine with doing it later after the consoles rework.
I'll leave the prioritization for John who is doing the work
and might have some preferences.
Best Regards,
Petr
Powered by blists - more mailing lists