summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorVishal Moola (Oracle) <vishal.moola@gmail.com>2022-11-01 20:53:25 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-12-12 05:12:13 +0300
commit284a344ed19dc92526024d062b30f90774fea50f (patch)
tree31a6b629e1cbc181d77cf6d059309891ccb27a9f /mm
parent28965f0f8be62e1ed8296fe0240b5d5dc064b681 (diff)
downloadlinux-284a344ed19dc92526024d062b30f90774fea50f.tar.xz
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/20221101175326.13265-5-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-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.