Re: [PATCH v2 1/2] tracing: ring-buffer: Have the ring buffer code do the vmap of physical memory
From: Mike Rapoport
Date: Tue Apr 01 2025 - 13:59:05 EST
On Tue, Apr 01, 2025 at 11:54:23AM -0400, Steven Rostedt wrote:
> On Tue, 1 Apr 2025 18:26:43 +0300
> Mike Rapoport <rppt@xxxxxxxxxx> wrote:
>
> > > But if I use vmap_page_range(), how do I give that back to the memory allocator?
> >
> > But you don't need neither vmap() nor vmap_page_range() to have kernel page
> > tables for memory that you get from reserve_mem. It's already mapped and
> > plain phys_to_virt() gives you the virtual address you can use.
>
> Oh! That makes things so much easier! Especially since that means it should
> work like the normal buffer where virt_to_page() should also work. Right?
Right.
> Now I do support mapping the persistent ring buffer via memmap, but I can
> just give up on allowing that to be memory mapped to user space, or even
> freed.
It can't be freed without jumping through some hoops, and mapping it to
user space is hassle as well.
--
Sincerely yours,
Mike.