lkml.org 
[lkml]   [2023]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] ring-buffer: Introducing ring-buffer mapping functions
On Wed, Mar 29, 2023 at 08:07:58AM -0400, Steven Rostedt wrote:
> On Wed, 29 Mar 2023 07:03:53 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > struct ring_buffer_meta_page_header {
> > #if __BITS_PER_LONG == 64
> > __u64 entries;
> > __u64 overrun;
> > #else
> > __u32 entries;
> > __u32 overrun;
> > #endif
> > __u32 pages_touched;
> > __u32 meta_page_size;
> > __u32 reader_page; /* page ID for the reader page */
> > __u32 nr_data_pages; /* doesn't take into account the reader_page */
> > };
> >
> > BTW, shouldn't the nr_data_pages take into account the reader page? As it
> > is part of the array we traverse isn't it?
>
> Ah, I guess nr_data_pages is the length of the index mapping, not the
> array of pages mapped?

Yes correct, data_pages[nr_data_pages] and the reader_page being excluded...
which might not be the easiest interface, as the size of the buffer to read
depends on if the reader_page has data to be read or not.

>
> -- Steve

\
 
 \ /
  Last update: 2023-03-29 14:28    [W:0.137 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site