On Fri, 29 Aug 2025 at 10:58, Arnaldo Carvalho de Melo <arnaldo.melo@xxxxxxxxx> wrote: > > Can't we continue with that idea by using some VMA sequential number that don't expose anything critical to user space but allows us to match stack entries to mmap records? No such record exists. I guess we could add an atomic ID to do_mmap() and have a 64-bit value that would be unique and would follow vma splitting and movement around. But it would actually be worse than just using the 'struct file' pointer, and the only advantage would be avoiding the hashing. And the disadvantages would be many. In particular, it would be much better if it was per-file, but we are *definitely* not adding some globally unique value to each file, because we already have seen performance issues with open/close loads just from the atomic sequence counters we used to give to anonymous inodes. (I say "used to give" - see get_next_ino() for what we do now, with per-cpu counter sequences. We'd have to do similar tricks for some kind of 'file ID', and I really don't want to do that with no reason). And if the only reason is "hashing takes a hundred cycles" when generating traces, that's just not a reason good enough to bloat core kernel data structures like 'struct file' and make core ops like open() more expensive. Linus