Re: [PATCH v15 2/6] ring-buffer: Introducing ring-buffer mapping functions

From: Steven Rostedt
Date: Fri Feb 09 2024 - 08:26:02 EST


On Fri, 9 Feb 2024 10:21:58 +0000
Vincent Donnefort <vdonnefort@xxxxxxxxxx> wrote:

> +static void rb_update_meta_page(struct ring_buffer_per_cpu *cpu_buffer)
> +{
> + struct trace_buffer_meta *meta = cpu_buffer->meta_page;
> +
> + WRITE_ONCE(meta->reader.read, cpu_buffer->reader_page->read);
> + WRITE_ONCE(meta->reader.id, cpu_buffer->reader_page->id);
> + WRITE_ONCE(meta->reader.lost_events, cpu_buffer->lost_events);
> +
> + WRITE_ONCE(meta->entries, local_read(&cpu_buffer->entries));
> + WRITE_ONCE(meta->overrun, local_read(&cpu_buffer->overrun));
> + WRITE_ONCE(meta->read, cpu_buffer->read);
> +

Small nit, but we should add a comment to the two flush_dache_folio() calls:

/* Some archs do not have data cache coherency between kernel and user space */
> + flush_dcache_folio(virt_to_folio(cpu_buffer->meta_page));
> +}
> +


-- Steve