Conversation

TIL since Linux 4.0 /proc/%d/pagemap has hidden PFNs as sensitive due to Rowhammer. I wonder if they could be reexposed under cryptographic cipher with same cipher used to address /proc/kpage*...
1
5
I'm seriously about to write a tool for detailed process memory usage analysis because all of the existing "how much memory X is using" metrics are so bogus.
1
9
Like at the very least, a report of not just how many but *which* pages are dirty. Getting fancier (not doing this now) reporting on what's in them, with heuristics (text? data structures with pointers? malloc framing matching known designs? etc.)
2
Replying to
AOSP adds a small feature to the kernel supporting naming anonymous VMAs, so they can be attributed to the source. It uses maps / pagemap to figure out what's actually used and to properly split shared memory between applications. Naming the anonymous VMAs isn't upstream though.
1
1
Replying to and
The prctl API they made for naming the anonymous VMAs isn't great because it requires an extra system call. It ended up causing too much overhead for spawning threads via pthread_create so they ended up removing the calls to it there. Ideally a name would just be passed to mmap.
2
Replying to
Sadly mmap is out of space for any additional arguments, and they wasted all the flag bits on useless hugetlb specific-pagesize requests (altho hopefully those bits can be repurposed when MAP_HUGETLB bit is clear...).
2
Replying to
There's not really a way to do that here. You can't change the function signature so you'd need a new function, and then you might as well use a new syscall with different convention.
1