All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH printk v2 3/4] printk: Skip unfinalized records in panic
Date: Wed, 18 Oct 2023 15:15:48 +0200	[thread overview]
Message-ID: <ZS_ahOpCQGNjDgSm@alley> (raw)
In-Reply-To: <877cnk72y9.fsf@jogness.linutronix.de>

On Wed 2023-10-18 10:30:46, John Ogness wrote:
> On 2023-10-17, John Ogness <john.ogness@linutronix.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.

Yeah, this look like a better solution. Anyway, we need to try reading
the messages behind prb_next_seq() up to the head of the ring buffer.
And @head_id is not available outside prb API.

> 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().

Sounds reasonable.

Best Regards,
Petr

  reply	other threads:[~2023-10-18 13:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13 20:43 [PATCH printk v2 0/4] fix console flushing on panic John Ogness
2023-10-13 20:43 ` [PATCH printk v2 1/4] printk: For @suppress_panic_printk check other panic John Ogness
2023-10-16 13:05   ` Petr Mladek
2023-10-13 20:43 ` [PATCH printk v2 2/4] printk: Add this_cpu_in_panic() John Ogness
2023-10-16 13:14   ` Petr Mladek
2023-10-13 20:43 ` [PATCH printk v2 3/4] printk: Skip unfinalized records in panic John Ogness
2023-10-17 11:27   ` Petr Mladek
2023-10-17 21:25     ` John Ogness
2023-10-18  8:24       ` John Ogness
2023-10-18 13:15         ` Petr Mladek [this message]
2023-10-18 12:54       ` Petr Mladek
2023-10-18 13:45         ` John Ogness
2023-10-18 15:27           ` Petr Mladek
2023-10-18 15:50             ` John Ogness
2023-10-19 10:29               ` Petr Mladek
2023-10-18 14:20         ` Petr Mladek
2023-10-23  9:53           ` John Ogness
2023-10-13 20:43 ` [PATCH printk v2 4/4] printk: Ignore waiter on panic John Ogness
2023-10-18  9:56   ` Petr Mladek
2023-10-23  9:15     ` John Ogness
2023-10-13 20:46 ` [PATCH printk v2 0/4] fix console flushing " John Ogness

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZS_ahOpCQGNjDgSm@alley \
    --to=pmladek@suse.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.