On Fri, 23 May 2025 17:28:57 -0400
Steven Rostedt <rost...@goodmis.org> wrote:

> On Fri, 23 May 2025 16:54:25 -0400
> Steven Rostedt <rost...@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) <mhira...@kernel.org>

Reply via email to