OSDN Git Service

mm/vmscan: allow arbitrary sized pages to be paged out
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 16 Oct 2020 03:05:56 +0000 (20:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Oct 2020 18:11:15 +0000 (11:11 -0700)
Remove the assumption that a compound page has HPAGE_PMD_NR pins from the
page cache.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SeongJae Park <sjpark@amazon.de>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: "Huang, Ying" <ying.huang@intel.com>
Link: https://lkml.kernel.org/r/20200908195539.25896-12-willy@infradead.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c

index 879fb57..fc4dee9 100644 (file)
@@ -725,8 +725,7 @@ static inline int is_page_cache_freeable(struct page *page)
         * that isolated the page, the page cache and optional buffer
         * heads at page->private.
         */
-       int page_cache_pins = PageTransHuge(page) && PageSwapCache(page) ?
-               HPAGE_PMD_NR : 1;
+       int page_cache_pins = thp_nr_pages(page);
        return page_count(page) - page_has_private(page) == 1 + page_cache_pins;
 }