Commit 1bee2c16 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

vmscan: use folio_mapped() in shrink_page_list()

Remove some legacy function calls.

Link: https://lkml.kernel.org/r/20220504182857.4013401-6-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent adf88aa8
...@@ -1572,7 +1572,7 @@ static unsigned int shrink_page_list(struct list_head *page_list, ...@@ -1572,7 +1572,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,
if (unlikely(!page_evictable(page))) if (unlikely(!page_evictable(page)))
goto activate_locked; goto activate_locked;
if (!sc->may_unmap && page_mapped(page)) if (!sc->may_unmap && folio_mapped(folio))
goto keep_locked; goto keep_locked;
/* /*
...@@ -1761,21 +1761,21 @@ static unsigned int shrink_page_list(struct list_head *page_list, ...@@ -1761,21 +1761,21 @@ static unsigned int shrink_page_list(struct list_head *page_list,
} }
/* /*
* The page is mapped into the page tables of one or more * The folio is mapped into the page tables of one or more
* processes. Try to unmap it here. * processes. Try to unmap it here.
*/ */
if (page_mapped(page)) { if (folio_mapped(folio)) {
enum ttu_flags flags = TTU_BATCH_FLUSH; enum ttu_flags flags = TTU_BATCH_FLUSH;
bool was_swapbacked = PageSwapBacked(page); bool was_swapbacked = folio_test_swapbacked(folio);
if (PageTransHuge(page) && if (folio_test_pmd_mappable(folio))
thp_order(page) >= HPAGE_PMD_ORDER)
flags |= TTU_SPLIT_HUGE_PMD; flags |= TTU_SPLIT_HUGE_PMD;
try_to_unmap(folio, flags); try_to_unmap(folio, flags);
if (page_mapped(page)) { if (folio_mapped(folio)) {
stat->nr_unmap_fail += nr_pages; stat->nr_unmap_fail += nr_pages;
if (!was_swapbacked && PageSwapBacked(page)) if (!was_swapbacked &&
folio_test_swapbacked(folio))
stat->nr_lazyfree_fail += nr_pages; stat->nr_lazyfree_fail += nr_pages;
goto activate_locked; goto activate_locked;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment