Re: [PATCH] mm/madvise: elevate page refcount while isolating in process_madvise()

From: Matthew Wilcox
Date: Wed Dec 15 2021 - 08:55:46 EST


On Wed, Dec 15, 2021 at 05:53:39PM +0530, Charan Teja Reddy wrote:
> The documentation of isolate_lru_page() says that, "it must be called
> with an elevated refcount on the page", which is not followed while
> isolating pages in process_madvise() system call with advise
> MADV_PAGEOUT. Fix it.

We hold the mmap_lock over the call to this function, so the reference
to the page from the page tables cannot go away. There's no need to
grab an extra reference here.