[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250401115423.3b6a926d@gandalf.local.home>
Date: Tue, 1 Apr 2025 11:54:23 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Mike Rapoport <rppt@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Masami
Hiramatsu <mhiramat@...nel.org>, Mark Rutland <mark.rutland@....com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, Vincent Donnefort <vdonnefort@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>, Kees Cook <kees@...nel.org>, Tony Luck
<tony.luck@...el.com>, "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2 1/2] tracing: ring-buffer: Have the ring buffer code
do the vmap of physical memory
On Tue, 1 Apr 2025 18:26:43 +0300
Mike Rapoport <rppt@...nel.org> 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?
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.
>
> > Calling vunmap() on that memory gives me:
> >
> > 1779.832484] ------------[ cut here ]------------
> > [ 1779.834076] Trying to vunmap() nonexistent vm area (000000027c000000)
> > [ 1779.835941] WARNING: CPU: 6 PID: 956 at mm/vmalloc.c:3413 vunmap+0x5a/0x60
> >
> > What's the proper way to say: "I no longer need this physical memory I
> > reserved, the kernel can now use it"?
>
> free_reserved_area()
Awesome!
Thanks,
-- Steve
Powered by blists - more mailing lists