summaryrefslogtreecommitdiff
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2020-10-16 06:05:56 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-10-16 21:11:15 +0300
commit3efe62e466958a1e59e68e0faa5c66b5b99b17ce (patch)
tree7c452c0de48cdab0de45ca8c692af29d4b95eb9f /mm/vmscan.c
parent8854a6a7248f6c372f1aa2a47b58027d3ba600c2 (diff)
downloadlinux-3efe62e466958a1e59e68e0faa5c66b5b99b17ce.tar.xz
mm/vmscan: allow arbitrary sized pages to be paged out
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>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 879fb57c5045..fc4dee9b91f8 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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;
}