On Fri, 13 Apr 2007 11:14:20 +1000 Nick Piggin <nickpiggin@yahoo.com.au> wrote:
Well hang on. This isn't a tool for understanding kernel behaviour. It's
a tool for understanding applciation behaviour.
So one doesn't ask "who is mapping that page" - that's a kernel developer
thing.
Instead, one says "what pages are being used by my application", then, for
each of those pages "what is that page's state". So the first step is to
collect all the pfns from /proc/$(pidof my-application)/pagemap and then to
use those pfns to look the individual pages up in /proc/kpagemap.
If you really want to know "who is using page 123435" then you'd need to
search /proc/*/pagemap. There are possibly legitimate reasons why an
application developer would want to at least pertially perform such an
operation ("who am I sharing with"), but I doubt if it's the common case.
hm, yes, there's plenty of precedent for that.
I akpm!
-