aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Moola (Oracle) <[email protected]>2022-11-01 10:53:25 -0700
committerAndrew Morton <[email protected]>2022-12-11 18:12:13 -0800
commit284a344ed19dc92526024d062b30f90774fea50f (patch)
tree31a6b629e1cbc181d77cf6d059309891ccb27a9f
parent28965f0f8be62e1ed8296fe0240b5d5dc064b681 (diff)
khugepage: replace lru_cache_add() with folio_add_lru()
Replaces some calls with their folio equivalents. This is in preparation for the removal of lru_cache_add(). This replaces 3 calls to compound_head() with 1. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Vishal Moola (Oracle) <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Miklos Szeredi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--mm/khugepaged.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 78ec2771cc65..5a7d2d5093f9 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -2013,6 +2013,7 @@ xa_unlocked:
if (result == SCAN_SUCCEED) {
struct page *page, *tmp;
+ struct folio *folio;
/*
* Replacing old pages with new one has succeeded, now we
@@ -2040,11 +2041,13 @@ xa_unlocked:
index++;
}
- SetPageUptodate(hpage);
- page_ref_add(hpage, HPAGE_PMD_NR - 1);
+ folio = page_folio(hpage);
+ folio_mark_uptodate(folio);
+ folio_ref_add(folio, HPAGE_PMD_NR - 1);
+
if (is_shmem)
- set_page_dirty(hpage);
- lru_cache_add(hpage);
+ folio_mark_dirty(folio);
+ folio_add_lru(folio);
/*
* Remove pte page tables, so we can re-fault the page as huge.