[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <844ivskxew.fsf@jogness.linutronix.de>
Date: Fri, 04 Jul 2025 13:34:23 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Petr Mladek <pmladek@...e.com>, Thomas Weißschuh
<thomas.weissschuh@...utronix.de>, Dan Carpenter
<dan.carpenter@...aro.org>
Cc: Steven Rostedt <rostedt@...dmis.org>, Sergey Senozhatsky
<senozhatsky@...omium.org>, Kees Cook <kees@...nel.org>, "Gustavo A . R .
Silva" <gustavoars@...nel.org>, David Gow <davidgow@...gle.com>, Arnd
Bergmann <arnd@...nel.org>, Arnd Bergmann <arnd@...db.de>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org, Petr Mladek
<pmladek@...e.com>
Subject: Re: [PATCH 1/3] printk: ringbuffer: Explain why the KUnit test
ignores failed writes
On 2025-07-02, Petr Mladek <pmladek@...e.com> wrote:
> The KUnit test ignores prb_reserve() failures on purpose. It tries
> to push the ringbuffer beyond limits.
>
> Note that it is a know problem that writes might fail in this situation.
> printk() tries to prevent this problem by:
>
> + allocating big enough data buffer, see log_buf_add_cpu().
>
> + allocating enough descriptors by using small enough average
> record, see PRB_AVGBITS.
>
> + storing the record with disabled interrupts, see vprintk_store().
>
> Also the amount of printk() messages is always somehow bound in
> practice. And they are serialized when they are printed from
> many CPUs on purpose, for example, when printing backtraces.
>
> Signed-off-by: Petr Mladek <pmladek@...e.com>
Reviewed-by: John Ogness <john.ogness@...utronix.de>
Powered by blists - more mailing lists