Re: [GIT PULL] ring-buffer: Updates for v6.15
From: Linus Torvalds
Date: Thu Mar 27 2025 - 21:32:26 EST
On Thu, 27 Mar 2025 at 18:24, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> The pages are never vmalloc'd, it's only ever vmap()'d on top of
> contiguous physical memory or allocated via alloc_page() in the order
> given. Thus, we do not support non consecutive physical memory.
Christ, that just makes it EVEN WORSE.
Just keep track of the actual original physical allocation, then!
By all means vmap it too for whoever wants the virtual allocation, but
remember the *real* allocation, and keep it as a 'struct page'
together with the order that you already have.
And then you never use vmalloc_to_page() - or even virt_to_page() - at
all, because you actually know your base allocation, and keep it in
that form that so much of this code wants in the first place.
Having a a nice reliable 'struct page *' (together with that size
order) and keeping it in that form would be *so* much cleaner.
Instead of randomly translating it to (two different!) kinds of
virtual kernel addresses and then translating it back when you wanted
the original proper format.
The random crazy hackery needs to stop. Really.
Linus