mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
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>
This commit is contained in:
parent
28965f0f8b
commit
284a344ed1
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user