From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.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 3/8] ring-buffer: Skip invalid sub-buffers when validating persistent ring buffer
Date: Wed, 29 Apr 2026 12:32:56 -0400 [thread overview]
Message-ID: <20260429123256.5172d581@gandalf.local.home> (raw)
In-Reply-To: <20260430001559.a2d0489d956c06059e13e58d@kernel.org>
On Thu, 30 Apr 2026 00:15:59 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> It should not be a never ending loop (there are other exit conditions),
> but I agreed. What about limiting with nr_subbufs?
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 5326924615a4..aa89ec96e964 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -5630,7 +5630,8 @@ __rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
> * a case where we will loop three times. There should be no
> * reason to loop four times (that I know of).
> */
> - if (RB_WARN_ON(cpu_buffer, ++nr_loops > 3)) {
> + if (RB_WARN_ON(cpu_buffer,
> + ++nr_loops > (cpu_buffer->ring_meta ? cpu_buffer->nr_subbufs : 3))) {
> reader = NULL;
> goto out;
> }
Yeah, this looks more reasonable.
Thanks,
-- Steve
next prev parent reply other threads:[~2026-04-29 16:32 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 [this message]
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
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=20260429123256.5172d581@gandalf.local.home \
--to=rostedt@goodmis.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=mhiramat@kernel.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