From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
Ian Rogers <irogers@google.com>
Subject: Re: [PATCH v14 4/5] ring-buffer: Reset RB_MISSED_* flags on persistent ring buffer
Date: Mon, 30 Mar 2026 14:36:13 -0400 [thread overview]
Message-ID: <20260330143613.42fe5640@gandalf.local.home> (raw)
In-Reply-To: <177487501981.3463592.2886576368556755178.stgit@mhiramat.tok.corp.google.com>
On Mon, 30 Mar 2026 21:50:20 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> Reset RB_MISSED_* flags when the persistent ring buffer is
> validated at boot. Since these flags are used only in reading
> process, such process should be stopped when reboot and never
> be restarted. Thus, these flags are meaningless in the next
> boot. Moreover, it can confuse the read process after reboot.
Is it meaningless on a second boot?
Let's say you have a crash, and there's an invalid buffer. On the next boot
it is flagged as invalid with the RB_MISSED flag. But then you reboot again
before looking at the buffer. The next boot will clear this flag. Now
looking at the persistent ring buffer will not show any missed events.
Ideally, it shouldn't matter how many reboots are made. If the persistent
ring buffer hasn't started again, it should always show the same output.
-- Steve
>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> ---
> Changes in v14:
> - Newly added.
> ---
> kernel/trace/ring_buffer.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index e5178239f2f9..5049cf13021e 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -1903,6 +1903,7 @@ static int rb_validate_buffer(struct buffer_page *bpage, int cpu,
> local_set(&bpage->page->commit, 0);
> } else {
> local_set(&bpage->entries, ret);
> + local_set(&bpage->page->commit, tail);
> }
>
> return ret;
next prev parent reply other threads:[~2026-03-30 18:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 12:49 [PATCH v14 0/5] ring-buffer: Making persistent ring buffers robust Masami Hiramatsu (Google)
2026-03-30 12:49 ` [PATCH v14 1/5] ring-buffer: Flush and stop persistent ring buffer on panic Masami Hiramatsu (Google)
2026-03-30 17:54 ` Steven Rostedt
2026-03-31 0:29 ` Masami Hiramatsu
2026-03-30 12:50 ` [PATCH v14 2/5] ring-buffer: Skip invalid sub-buffers when validating persistent ring buffer Masami Hiramatsu (Google)
2026-03-30 20:22 ` Steven Rostedt
2026-03-30 20:28 ` Steven Rostedt
2026-03-31 1:24 ` Masami Hiramatsu
2026-03-30 12:50 ` [PATCH v14 3/5] ring-buffer: Skip invalid sub-buffers when rewinding " Masami Hiramatsu (Google)
2026-03-30 12:50 ` [PATCH v14 4/5] ring-buffer: Reset RB_MISSED_* flags on " Masami Hiramatsu (Google)
2026-03-30 18:36 ` Steven Rostedt [this message]
2026-03-31 1:43 ` Masami Hiramatsu
2026-03-30 12:50 ` [PATCH v14 5/5] ring-buffer: Add persistent ring buffer selftest Masami Hiramatsu (Google)
2026-03-30 20:24 ` Steven Rostedt
2026-03-31 4:12 ` Masami Hiramatsu
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=20260330143613.42fe5640@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox