From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
Ian Rogers <irogers@google.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v18 4/8] ring-buffer: Skip invalid sub-buffers when rewinding persistent ring buffer
Date: Thu, 30 Apr 2026 00:20:23 +0900 [thread overview]
Message-ID: <20260430002023.b19608c27a746284e8f73b80@kernel.org> (raw)
In-Reply-To: <20260428162146.78e52988@gandalf.local.home>
On Tue, 28 Apr 2026 16:21:46 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Fri, 24 Apr 2026 15:52:35 +0900
> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
>
> > @@ -1892,9 +1895,19 @@ static int rb_validate_buffer(struct buffer_data_page *dpage, int cpu,
> > * subbuf_size is considered invalid.
> > */
> > tail = local_read(&dpage->commit) & ~RB_MISSED_MASK;
> > - if (tail > meta->subbuf_size - BUF_PAGE_HDR_SIZE)
> > - return -1;
> > - return rb_read_data_buffer(dpage, tail, cpu, &ts, &delta);
> > + if (tail <= meta->subbuf_size - BUF_PAGE_HDR_SIZE)
> > + ret = rb_read_data_buffer(dpage, tail, cpu, &ts, &delta);
> > +
>
> This code seriously needs comments.
OK, I'll add it, or let code explain clearer?
if (tail <= meta->subbuf_size - BUF_PAGE_HDR_SIZE)
ret = rb_read_data_buffer(dpage, tail, cpu, &ts, &delta);
else
ret = -1;
Thanks,
>
> -- Steve
>
> > + if (ret < 0 || (prev_ts && prev_ts > ts) || (next_ts && ts > next_ts)) {
> > + local_set(&bpage->entries, 0);
> > + local_set(&bpage->page->commit, 0);
> > + bpage->page->time_stamp = prev_ts ? prev_ts : next_ts;
> > + ret = -1;
> > + } else {
> > + local_set(&bpage->entries, ret);
> > + }
> > +
> > + return ret;
> > }
> >
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2026-04-29 15:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 6:51 [PATCH v18 0/8] ring-buffer: Making persistent ring buffers robust Masami Hiramatsu (Google)
2026-04-24 6:52 ` [PATCH v18 1/8] ring-buffer: Do not double count the reader_page Masami Hiramatsu (Google)
2026-04-24 6:52 ` [PATCH v18 2/8] ring-buffer: Flush and stop persistent ring buffer on panic Masami Hiramatsu (Google)
2026-04-24 6:52 ` [PATCH v18 3/8] ring-buffer: Skip invalid sub-buffers when validating persistent ring buffer Masami Hiramatsu (Google)
2026-04-28 19:55 ` Steven Rostedt
2026-04-29 15:15 ` Masami Hiramatsu
2026-04-29 16:32 ` Steven Rostedt
2026-04-24 6:52 ` [PATCH v18 4/8] ring-buffer: Skip invalid sub-buffers when rewinding " Masami Hiramatsu (Google)
2026-04-28 20:21 ` Steven Rostedt
2026-04-29 15:20 ` Masami Hiramatsu [this message]
2026-04-29 16:39 ` Steven Rostedt
2026-04-24 6:52 ` [PATCH v18 5/8] ring-buffer: Add persistent ring buffer invalid-page inject test Masami Hiramatsu (Google)
2026-04-24 6:52 ` [PATCH v18 6/8] ring-buffer: Show commit numbers in buffer_meta file Masami Hiramatsu (Google)
2026-04-24 6:52 ` [PATCH v18 7/8] ring-buffer: Cleanup persistent ring buffer validation Masami Hiramatsu (Google)
2026-04-28 20:24 ` Steven Rostedt
2026-04-29 15:21 ` Masami Hiramatsu
2026-04-29 15:50 ` Steven Rostedt
2026-04-24 6:53 ` [PATCH v18 8/8] ring-buffer: Cleanup buffer_data_page related code Masami Hiramatsu (Google)
2026-04-24 7:06 ` [PATCH v18 0/8] ring-buffer: Making persistent ring buffers robust 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=20260430002023.b19608c27a746284e8f73b80@kernel.org \
--to=mhiramat@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=irogers@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.org \
--cc=will@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