On Thu, Nov 09, 2023 at 03:43:10PM +0000, jeff.xie@xxxxxxxxx wrote: > November 9, 2023 at 10:09 PM, "Matthew Wilcox" <willy@xxxxxxxxxxxxx> 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.