Re: [PATCH] ring-buffer: Include dropped pages in counting dirty patches

From: Steven Rostedt
Date: Mon Oct 24 2022 - 12:12:55 EST


On Mon, 24 Oct 2022 22:13:28 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:

> > @@ -2020,6 +2029,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages)
> > */
> > local_add(page_entries, &cpu_buffer->overrun);
> > local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes);
> > + local_inc(&cpu_buffer->pages_lost);
>
> Maybe we can make this part a static helper function so that we don't
> repeat it below?

Makes sense. I'll send a v2.

-- Steve

>
> > }
> >
> > /*
> > @@ -2504,6 +2514,7 @@ rb_handle_head_page(struct ring_buffer_per_cpu *cpu_buffer,
> > */
> > local_add(entries, &cpu_buffer->overrun);
> > local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes);
> > + local_inc(&cpu_buffer->pages_lost);