Re: [GIT PULL] tracing: Updates for v6.9
From: Linus Torvalds
Date: Sat Mar 16 2024 - 13:00:26 EST
On Sat, 16 Mar 2024 at 09:31, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> So instead of merging a new feature that was mis-designed and is
> already having code working around its mis-design, I'm not merging it
> at all.
Here's a clue: when hacking up VFS code, ask for ACK's from the VFS people.
And when hacking up MM code, make damn sure that you have VM people involved.
No more of this "random code that happens to work in my tests"
garbage. Yes, I'm sure that others have done this same disgusting page
counting hack and this was copied-and-pasted from some other
disgusting source, but because of all the history, I'm now looking at
tracing pulls arefully, and I'm simply not allowing any broken hacks.
So in addition to getting actual VM people to help you with mapping
stuff (hard requirement), I would also suggest:
- your allocation has to be live over the whole mmap (and that's due
to other fundamental issues - you're not even trying to deal with
actual dynamic allocations and thank Cthulhu for that), and the code
is literally designed that way, so then faulting pages in one at a
time and refcounting them one at a time is just pointless and wrong.
Just do it all at mmap time.
- I'd suggest marking it all VM_DONTCOPY | VM_IO | VM_DONTEXPAND to
not let people play games with the mapping.
- avoid all the sub-page ref-counts entirely by using VM_PFNMAP, and
use vm_insert_pages()
and a random note:
- from a TLB pressure standpoint, it might be a good idea to try to
keep the page table entries naturally aligned, so putting that one
status page at the beginning is likely a bad idea. It will typically
mean that hardware that can silently use larger TLB entries for
aligned pages won't be able to do so.
but the effect of that is likely fairly small.
Linus