[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877cnk72y9.fsf@jogness.linutronix.de>
Date: Wed, 18 Oct 2023 10:30:46 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Petr Mladek <pmladek@...e.com>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH printk v2 3/4] printk: Skip unfinalized records in panic
On 2023-10-17, John Ogness <john.ogness@...utronix.de> wrote:
>>> - if (!prb_read_valid(prb, seq, &r))
>>> - return false;
>>> + while (!prb_read_valid(prb, seq, &r)) {
>>> + if (this_cpu_in_panic() && seq < prb_next_seq(prb)) {
>>> + /*
>>> + * The record @seq is not finalized and there may be
I am wondering if we should put the this_cpu_in_panic() check into
_prb_read_valid() instead. This has the advantage that it could more
intelligently skip non-finalized records and not need to rely on
prb_next_seq(). Also, it would allow any other readers (kmsg_dump) to
skip non-finalized records during panic.
Looking over the code, it would be easy to extend
desc_read_finalized_seq() to return a separate error code for exists but
is non-finalized. This would make it trivial for _prb_read_valid() to
skip over it when this_cpu_in_panic().
John
Powered by blists - more mailing lists