Re: [RFC][PATCH 3/4] filemap: implement filemap allocate post callback for page_owner

Matthew Wilcox
2023-11-09T15:49:16Z

On Thu, Nov 09, 2023 at 03:43:10PM +0000, jeff.xie@linux.dev wrote:
> November 9, 2023 at 10:09 PM, "Matthew Wilcox" <willy@infradead.org> wrote:
> > Why not just walk the rmap directly to find out where it's mapped in
> > any process instead of the one which allocated it?
>
> Since the page_owner's result only shows which PID allocated this page, we only need to obtain the address space of the corresponding process for that PID.

But that's probably uninteresting. Consider, eg, a page from libc.
That's going to be mapped by hundreds or even thousands of processes.
And the one which originally allocated it may well have exited by this
point; files often live long past the process that first reads them.