From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] tracing: ring_buffer: Rewind persistent ring buffer when reboot
Date: Mon, 26 May 2025 12:03:42 +0900 [thread overview]
Message-ID: <20250526120342.cdcfca9ac3c2161d48c03af5@kernel.org> (raw)
In-Reply-To: <20250523172857.02ab4a75@gandalf.local.home>
On Fri, 23 May 2025 17:28:57 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Fri, 23 May 2025 16:54:25 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > I think we also need this:
> >
> > diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> > index 7d837963dd1e..456efebc396a 100644
> > --- a/kernel/trace/ring_buffer.c
> > +++ b/kernel/trace/ring_buffer.c
> > @@ -3638,6 +3638,9 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,
> >
> > rb_reset_tail(cpu_buffer, tail, info);
> >
> > + /* The new page should have zero committed */
> > + rb_init_page(next_page->page);
> > +
> > /* Commit what we have for now. */
> > rb_end_commit(cpu_buffer);
> > /* rb_end_commit() decs committing */
>
> No we don't need it ;-)
>
> I'm looking deeper into the code and we have this:
>
> /*
> * No need to worry about races with clearing out the commit.
> * it only can increment when a commit takes place. But that
> * only happens in the outer most nested commit.
> */
> local_set(&next_page->page->commit, 0);
>
> When the tail page gets moved.
Yeah, when the page gets written, it is cleared.
Thanks,
>
> -- Steve
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2025-05-26 3:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-22 15:54 [PATCH v3 0/2] tracing: Rewind persistent ring buffer Masami Hiramatsu (Google)
2025-05-22 15:54 ` [PATCH v3 1/2] tracing: ring_buffer: Rewind persistent ring buffer when reboot Masami Hiramatsu (Google)
2025-05-23 20:54 ` Steven Rostedt
2025-05-23 21:28 ` Steven Rostedt
2025-05-26 3:03 ` Masami Hiramatsu [this message]
2025-05-27 0:17 ` Masami Hiramatsu
2025-05-27 3:15 ` Masami Hiramatsu
2025-05-27 3:54 ` Masami Hiramatsu
2025-05-27 13:47 ` Steven Rostedt
2025-05-28 0:22 ` Masami Hiramatsu
2025-05-23 23:20 ` Steven Rostedt
2025-05-26 3:44 ` Masami Hiramatsu
2025-05-27 13:48 ` Steven Rostedt
2025-06-03 16:00 ` Steven Rostedt
2025-06-03 21:58 ` Masami Hiramatsu
2025-05-22 15:54 ` [PATCH v3 2/2] tracing: Reset last-boot buffers when reading out all cpu buffers Masami Hiramatsu (Google)
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=20250526120342.cdcfca9ac3c2161d48c03af5@kernel.org \
--to=mhiramat@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®