Re: [PATCH v5 1/2] ring-buffer: Introducing ring-buffer mapping functions

From: Steven Rostedt
Date: Wed Aug 02 2023 - 07:45:33 EST


On Tue, 1 Aug 2023 13:26:03 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > +
> > + if (READ_ONCE(cpu_buffer->mapped)) {
> > + /* Ensure the meta_page is ready */
> > + smp_rmb();
> > + WRITE_ONCE(cpu_buffer->meta_page->pages_touched,
> > + local_read(&cpu_buffer->pages_touched));
> > + }
>
> I was thinking instead of doing this in the semi fast path, put this logic
> into the rb_wakeup_waiters() code. That is, if a task is mapped, we call
> the irq_work() to do this for us. It could even do more, like handle
> blocked mapped waiters.

I was thinking how to implement this, and I worry that it may cause an irq
storm. Let's keep this (and the other locations) as is, where we do the
updates in place. Then we can look at seeing if it is possible to do it in
a delayed fashion another time.

-- Steve