[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210311105055.4a0e864d@xps13>
Date: Thu, 11 Mar 2021 10:50:55 +0100
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Petr Mladek <pmladek@...e.com>,
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, Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
linux-mtd@...ts.infradead.org
Subject: Re: [PATCH next v4 02/15] mtd: mtdoops: synchronize kmsg_dumper
Hello,
John Ogness <john.ogness@...utronix.de> wrote on Wed, 3 Mar 2021
11:15:15 +0100:
> The kmsg_dumper can be called from any context and CPU, possibly
> from multiple CPUs simultaneously. Since the writing of the buffer
> can occur from a later scheduled work queue, the oops buffer must
> be protected against simultaneous dumping.
>
> Use an atomic bit to mark when the buffer is protected. Release the
> protection in between setting the buffer and the actual writing in
> order for a possible panic (immediate write) to be written during
> the scheduling of a previous oops (delayed write).
>
> An atomic bit (rather than a spinlock) was chosen so that no
> scheduling or preemption side-effects would be introduced. The MTD
> kmsg_dumper may dump directly or it may be delayed (via scheduled
> work). Depending on the context, different MTD callbacks are used.
> For example, mtd_write() expects to be called in a non-atomic
> context and may take a mutex.
>
> Signed-off-by: John Ogness <john.ogness@...utronix.de>
> Reviewed-by: Petr Mladek <pmladek@...e.com>
Reviewed-by: Miquel Raynal <miquel.raynal@...tlin.com>
Thanks,
Miquèl
Powered by blists - more mailing lists