Re: [RFCv1 0/6] Page Detective
From: Andi Kleen
Date: Wed Nov 20 2024 - 14:16:21 EST
> - Quickly identify all user processes mapping a given page.
Can be done with /proc/*/pagemap today. Maybe it's not "quick"
because it won't use the rmap chains, but is that a serious
issue?
> - Determine if and where the kernel maps the page, which is also
> important given the opportunity to remove guest memory from the kernel
> direct map (as discussed at LPC'24).
At least x86 already has a kernel page table dumper in debugfs
that can be used for this. The value of a second redundant
one seems low.
> We also plan to extend this functionality to include KVM and IOMMU
> page tables in the future.
Yes dumpers for those would likely be useful.
(at least for the case when one hand is tied behind your back
by security policies forbidding /proc/kcore access)
> <pagemap> provides an interface to traversing through user page
> tables, but the other information cannot be extracted using the
> existing interfaces.
Like what? You mean the reference counts?
/proc/k* doesn't have any reference counts, and no space
for full counts, but I suspect usually all you need to know is a
few states like (>1, 1, 0, maybe negative) which could be mapped to a
few spare kpageflags bits.
That said I thought Willy wanted to move a lot of these
elsewhere anyways with the folio revolution, so it might
be a short lived interface anyways.
-Andi