remove add/del page to lru functions
Subsystems (13)
cover remove add/del page to lru functions
From: Alex Shi <[email protected]>
Couple of old page/lru operation funcs are just inline replaced. Remove them to reduce function name remember and make code simple.
Thanks
Alex
Alex Shi (5):
mm: remove page_is_file_lru function
mm: remove __clear_page_lru_flags()
mm: remove add_page_to_lru_list() function
mm: remove add_page_to_lru_list_tail()
mm: remove del_page_from_lru_list()
include/linux/mm_inline.h | 28 ---------------------------- include/trace/events/vmscan.h | 2 +- mm/compaction.c | 4 ++-- mm/gup.c | 2 +- mm/khugepaged.c | 4 ++-- mm/memory-failure.c | 2 +- mm/memory_hotplug.c | 2 +- mm/mempolicy.c | 2 +- mm/migrate.c | 14 +++++++------- mm/mlock.c | 2 +- mm/mprotect.c | 2 +- mm/swap.c | 22 +++++++++++----------- mm/vmscan.c | 23 ++++++++++++----------- 13 files changed, 41 insertions(+), 68 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/5 mm: remove page_is_file_lru function
From: Alex Shi <[email protected]>
This function could be full replaced by folio_is_file_lru, so no reason to keep a duplicate function.
--- include/linux/mm_inline.h | 5 ----- include/trace/events/vmscan.h | 2 +- mm/compaction.c | 2 +- mm/gup.c | 2 +- mm/khugepaged.c | 4 ++-- mm/memory-failure.c | 2 +- mm/memory_hotplug.c | 2 +- mm/mempolicy.c | 2 +- mm/migrate.c | 14 +++++++------- mm/mprotect.c | 2 +- mm/vmscan.c | 13 +++++++------ 11 files changed, 23 insertions(+), 27 deletions(-)
include/linux/mm_inline.h +0 -5
@@ -27,11 +27,6 @@ static inline int folio_is_file_lru(struct folio *folio)return !folio_test_swapbacked (folio); } -static inline int page_is_file_lru (struct page *page) -{ -return folio_is_file_lru (page_folio (page)); -} - static __always_inline void update_lru_size(struct lruvec *lruvec,enum lru_list lru,enum zone_type zid,long nr_pages)
include/trace/events/vmscan.h +1 -1
@@ -341,7 +341,7 @@ TRACE_EVENT(mm_vmscan_writepage,TP_fast_assign ( __entry->pfn = page_to_pfn(page); __entry->reclaim_flags =trace_reclaim_flags ( -page_is_file_lru (page)); +folio_is_file_lru (page_folio (page))); ), TP_printk("page=%p pfn=0x%lx flags=%s",
mm/compaction.c +1 -1
@@ -1066,7 +1066,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,/* Successfully isolated */ del_page_from_lru_list (page, lruvec);mod_node_page_state (page_pgdat (page), -NR_ISOLATED_ANON +page_is_file_lru (page), +NR_ISOLATED_ANON +folio_is_file_lru (page_folio (page)),thp_nr_pages (page)); isolate_success:
mm/gup.c +1 -1
@@ -1900,7 +1900,7 @@ static long check_and_migrate_movable_pages(unsigned long nr_pages,list_add_tail (&head->lru, &movable_page_list);mod_node_page_state (page_pgdat (head),NR_ISOLATED_ANON + -page_is_file_lru (head), +folio_is_file_lru (page_folio (head)),thp_nr_pages (head)); } }
mm/khugepaged.c +2 -2
@@ -561,7 +561,7 @@ void __khugepaged_exit(struct mm_struct *mm)static void release_pte_page (struct page *page) {mod_node_page_state (page_pgdat (page), -NR_ISOLATED_ANON +page_is_file_lru (page), +NR_ISOLATED_ANON +folio_is_file_lru (page_folio (page)), -compound_nr (page));unlock_page (page);putback_lru_page (page);
@@ -703,7 +703,7 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma, goto out; }mod_node_page_state (page_pgdat (page), -NR_ISOLATED_ANON +page_is_file_lru (page), +NR_ISOLATED_ANON +folio_is_file_lru (page_folio (page)),compound_nr (page));VM_BUG_ON_PAGE (!PageLocked (page), page);VM_BUG_ON_PAGE (PageLRU (page), page);
mm/memory-failure.c +1 -1
@@ -2113,7 +2113,7 @@ static bool isolate_page(struct page *page, struct list_head *pagelist)if (isolated && lru)inc_node_page_state (page,NR_ISOLATED_ANON + -page_is_file_lru (page)); +folio_is_file_lru (page_folio (page)));/* * If we succeed to isolate the page, we grabbed another refcount on
mm/memory_hotplug.c +1 -1
@@ -1731,7 +1731,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)list_add_tail (&page->lru, &source);if (!__PageMovable (page))inc_node_page_state (page,NR_ISOLATED_ANON + -page_is_file_lru (page)); +folio_is_file_lru (page_folio (page))); }else {if (__ratelimit (&migrate_rs)) {
mm/mempolicy.c +1 -1
@@ -1032,7 +1032,7 @@ static int migrate_page_add(struct page *page, struct list_head *pagelist,if (!isolate_lru_page (head)) {list_add_tail (&head->lru, pagelist);mod_node_page_state (page_pgdat (head), -NR_ISOLATED_ANON +page_is_file_lru (head), +NR_ISOLATED_ANON +folio_is_file_lru (page_folio (head)),thp_nr_pages (head)); }else if (flags &MPOL_MF_STRICT ) {/*
mm/migrate.c +7 -7
@@ -164,7 +164,7 @@ void putback_movable_pages(struct list_head *l)put_page (page); }else {mod_node_page_state (page_pgdat (page),NR_ISOLATED_ANON + -page_is_file_lru (page), -thp_nr_pages (page)); +folio_is_file_lru (page_folio (page)), -thp_nr_pages (page));putback_lru_page (page); } }
@@ -1129,7 +1129,7 @@ static int unmap_and_move(new_page_t get_new_page,*/ if (likely (!__PageMovable (page)))mod_node_page_state (page_pgdat (page),NR_ISOLATED_ANON + -page_is_file_lru (page), -thp_nr_pages (page)); +folio_is_file_lru (page_folio (page)), -thp_nr_pages (page));if (reason !=MR_MEMORY_FAILURE )/*
@@ -1657,7 +1657,7 @@ static int add_page_for_migration(struct mm_struct *mm, unsigned long addr, err =1 ;list_add_tail (&head->lru, pagelist);mod_node_page_state (page_pgdat (head), -NR_ISOLATED_ANON +page_is_file_lru (head), +NR_ISOLATED_ANON +folio_is_file_lru (page_folio (head)),thp_nr_pages (head)); } out_putpage:
@@ -2048,7 +2048,7 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)if (isolate_lru_page (page))return 0 ; - page_lru =page_is_file_lru (page); + page_lru =folio_is_file_lru (page_folio (page));mod_node_page_state (page_pgdat (page),NR_ISOLATED_ANON + page_lru, nr_pages);
@@ -2093,7 +2093,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,* Don't migrate file pages that are mapped in multiple processes * with execute permissions as they are probably shared libraries. */ -if (page_mapcount (page) !=1 &&page_is_file_lru (page) && +if (page_mapcount (page) !=1 &&folio_is_file_lru (page_folio (page)) && (vma->vm_flags &VM_EXEC )) goto out;
@@ -2101,7 +2101,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,* Also do not migrate dirty pages as not all filesystems can move * dirty pages in MIGRATE_ASYNC mode which is a waste of cycles. */ -if (page_is_file_lru (page) &&PageDirty (page)) +if (folio_is_file_lru (page_folio (page)) &&PageDirty (page)) goto out; isolated =numamigrate_isolate_page (pgdat, page);
@@ -2115,7 +2115,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,if (!list_empty (&migratepages)) {list_del (&page->lru);mod_node_page_state (page_pgdat (page),NR_ISOLATED_ANON + -page_is_file_lru (page), -nr_pages); +folio_is_file_lru (page_folio (page)), -nr_pages);putback_lru_page (page); } isolated =0 ;
mm/mprotect.c +1 -1
@@ -102,7 +102,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,* it cannot move them all from MIGRATE_ASYNC * context. */ -if (page_is_file_lru (page) &&PageDirty (page)) +if (folio_is_file_lru (page_folio (page)) &&PageDirty (page))continue ;/*
mm/vmscan.c +7 -6
@@ -1311,7 +1311,7 @@ static int __remove_mapping(struct address_space *mapping, struct page *page,* exceptional entries and shadow exceptional entries in the * same address_space. */ -if (reclaimed &&page_is_file_lru (page) && +if (reclaimed &&folio_is_file_lru (page_folio (page)) && !mapping_exiting (mapping) && !dax_mapping (mapping)) shadow =workingset_eviction (page, target_memcg);__delete_from_page_cache (page, shadow);
@@ -1438,7 +1438,7 @@ static void page_check_dirty_writeback(struct page *page,* Anonymous pages are not handled by flushers and must be written * from reclaim context. Do not stall reclaim based on them */ -if (!page_is_file_lru (page) || +if (!folio_is_file_lru (page_folio (page)) || (PageAnon (page) && !PageSwapBacked (page))) { *dirty = false; *writeback = false;
@@ -1777,7 +1777,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,* the rest of the LRU for clean pages and see * the same dirty pages again (PageReclaim). */ -if (page_is_file_lru (page) && +if (folio_is_file_lru (page_folio (page)) && (!current_is_kswapd () || !PageReclaim (page) || !test_bit (PGDAT_DIRTY , &pgdat->flags))) {/*
@@ -1927,7 +1927,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,try_to_free_swap (page);VM_BUG_ON_PAGE (PageActive (page), page);if (!PageMlocked (page)) { -int type =page_is_file_lru (page); +int type =folio_is_file_lru (page_folio (page));SetPageActive (page); stat->nr_activate[type] += nr_pages;count_memcg_page_event (page,PGACTIVATE );
@@ -1976,7 +1976,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,unsigned int noreclaim_flag;list_for_each_entry_safe (page, next, page_list, lru) { -if (!PageHuge (page) &&page_is_file_lru (page) && +if (!PageHuge (page) &&folio_is_file_lru (page_folio (page)) && !PageDirty (page) && !__PageMovable (page) && !PageUnevictable (page)) {ClearPageActive (page);
@@ -2555,7 +2555,8 @@ static void shrink_active_list(unsigned long nr_to_scan,* IO, plus JVM can create lots of anon VM_EXEC pages, * so we ignore them here. */ -if ((vm_flags &VM_EXEC ) &&page_is_file_lru (page)) { +if ((vm_flags &VM_EXEC ) && +folio_is_file_lru (page_folio (page))) { nr_rotated +=thp_nr_pages (page);list_add (&page->lru, &l_active);continue ;
Signature · 1 line
2.25.1
Re: [PATCH 1/5] mm: remove page_is_file_lru function
Quoted 4 lines · On Thu, Jan 20, 2022 at 09:10:20PM +0800, [email protected] wrote:
From: Alex Shi <[email protected]>
This function could be full replaced by
folio_is_file_lru, so no reason to keep a duplicate function.
This is not a helpful way to do this kind of replacement.
Instead of choosing a function to remove and doing a blind replacement, choose a call site and convert the whole calling function to use folios. Once you've removed all callers, you can remove the wrapper function.
Also, a number of changes here will conflict with patches I've already posted. Try doing change_pte_range() in mprotect.c to get a feel for how to convert a function entirely to folios.
Re: [PATCH 1/5] mm: remove page_is_file_lru function
Quoted 9 lines · Matthew Wilcox
Quoted 4 lines · On Thu, Jan 20, 2022 at 09:10:20PM +0800, [email protected] wrote:
From: Alex Shi <[email protected]>
This function could be full replaced by
folio_is_file_lru, so no reason to keep a duplicate function.This is not a helpful way to do this kind of replacement.
Quoted 7 lines
Instead of choosing a function to remove and doing a blind replacement, choose a call site and convert the whole calling function to use folios. Once you've removed all callers, you can remove the wrapper function.
Also, a number of changes here will conflict with patches I've already posted. Try doing
change_pte_range()inmprotect.cto get a feel for how to convert a function entirely to folios.
Hi Willy,
Thanks for your comments!
The patchset did the thing as you required "convert the whole calling function to use folios. then remove the wrapper function" on yesterday's Linus and next tree, that included your patchset "Page cache/iomap for 5.17".
Is the conflicting patch "Enabling large folios for 5.17" or others? Sorry for can't check everyone, your patches are many. If just the former, I see you mentioned: "I'd be uncomfortable seeing it merged before 5.18". Would you point out which of your patches was interfered or blocked?
And yes, replacing page functions in change_pte_range is a bit harder, but it seems it has no much relation with this trival patchset.
Thanks
Alex
Re: [PATCH 1/5] mm: remove page_is_file_lru function
Quoted 18 lines · Alex Shi
Quoted 9 lines · Matthew Wilcox
Quoted 4 lines · On Thu, Jan 20, 2022 at 09:10:20PM +0800, [email protected] wrote:
From: Alex Shi <[email protected]>
This function could be full replaced by
folio_is_file_lru, so no reason to keep a duplicate function.This is not a helpful way to do this kind of replacement.
Quoted 7 lines
Instead of choosing a function to remove and doing a blind replacement, choose a call site and convert the whole calling function to use folios. Once you've removed all callers, you can remove the wrapper function.
Also, a number of changes here will conflict with patches I've already posted. Try doing
change_pte_range()inmprotect.cto get a feel for how to convert a function entirely to folios.
Quoted 7 lines
Hi Willy,
Thanks for your comments!
The patchset did the thing as you required "convert the whole calling function to use folios. then remove the wrapper function" on yesterday's Linus and next tree, that included your patchset "Page cache/iomap for 5.17".
That's not what I meant. What I meant is you're currently doing:
- Find folio wrapper function
- Inline it into all callers
- Delete wrapper function
That creates a lot of churn and not a lot of improvement.
What would be helpful is doing:
- Find folio wrapper function
- Find a caller, convert it from using pages to using folios
That's harder, but it actually accomplishes something (ie auditing a function to make it work with folios). These wrapper functions are signals that the callers need to be converted to use folios.
Quoted 4 lines
Is the conflicting patch "Enabling large folios for 5.17" or others? Sorry for can't check everyone, your patches are many. If just the former, I see you mentioned: "I'd be uncomfortable seeing it merged before 5.18". Would you point out which of your patches was interfered or blocked?
The GUP series was the specific series that this conflicted with. And yes, I have a lot of patches outstanding in this area. That's a sign that small cleanup patches aren't going to be welcomed because they're going to conflict with meaningful patches.
Quoted 2 lines
And yes, replacing page functions in
change_pte_rangeis a bit harder, but it seems it has no much relation with this trival patchset.
That is, indeed, the point.
PATCH 2/5 mm: remove __clear_page_lru_flags()
In reply to [email protected]From: Alex Shi <[email protected]>
The function could be fully replaced by __folio_clear_lru_flags(), no reason to keep a duplicate one.
--- include/linux/mm_inline.h | 5 ----- mm/swap.c | 4 ++-- mm/vmscan.c | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-)
include/linux/mm_inline.h +0 -5
@@ -59,11 +59,6 @@ static __always_inline void __folio_clear_lru_flags(struct folio *folio)__folio_clear_unevictable (folio); } -static __always_inline void __clear_page_lru_flags(struct page *page) -{ -__folio_clear_lru_flags (page_folio (page)); -} -/** * folio_lru_list - Which LRU list should a folio be on? * @folio: The folio to test.
mm/swap.c +2 -2
@@ -86,7 +86,7 @@ static void __page_cache_release(struct page *page) lruvec =folio_lruvec_lock_irqsave (folio, &flags);del_page_from_lru_list (page, lruvec); -__clear_page_lru_flags (page); +__folio_clear_lru_flags (page_folio (page));unlock_page_lruvec_irqrestore (lruvec, flags); }__ClearPageWaiters (page);
@@ -966,7 +966,7 @@ void release_pages(struct page **pages, int nr) lock_batch =0 ;del_page_from_lru_list (page, lruvec); -__clear_page_lru_flags (page); +__folio_clear_lru_flags (page_folio (page)); }__ClearPageWaiters (page);
mm/vmscan.c +1 -1
@@ -2337,7 +2337,7 @@ static unsigned int move_pages_to_lru(struct lruvec *lruvec,SetPageLRU (page);if (unlikely (put_page_testzero (page))) { -__clear_page_lru_flags (page); +__folio_clear_lru_flags (page_folio (page));if (unlikely (PageCompound (page))) {spin_unlock_irq (&lruvec->lru_lock);
Signature · 1 line
2.25.1
PATCH 3/5 mm: remove add_page_to_lru_list() function
In reply to [email protected]From: Alex Shi <[email protected]>
The function could be fully replaced by ruvec_add_folio(), no reason to keep a duplicate one.
--- include/linux/mm_inline.h | 6 ------ mm/swap.c | 6 +++--- mm/vmscan.c | 4 ++-- 3 files changed, 5 insertions(+), 11 deletions(-)
include/linux/mm_inline.h +0 -6
@@ -92,12 +92,6 @@ void lruvec_add_folio(struct lruvec *lruvec, struct folio *folio)list_add (&folio->lru, &lruvec->lists[lru]); } -static __always_inline void add_page_to_lru_list(struct page *page, -struct lruvec *lruvec) -{ -lruvec_add_folio (lruvec,page_folio (page)); -} -static __always_inline void lruvec_add_folio_tail(struct lruvec *lruvec, struct folio *folio) {
mm/swap.c +3 -3
@@ -543,7 +543,7 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec)* It can make readahead confusing. But race window * is _really_ small and it's non-critical problem. */ -add_page_to_lru_list (page, lruvec); +lruvec_add_folio (lruvec,page_folio (page));SetPageReclaim (page); }else {/*
@@ -569,7 +569,7 @@ static void lru_deactivate_fn(struct page *page, struct lruvec *lruvec)del_page_from_lru_list (page, lruvec);ClearPageActive (page);ClearPageReferenced (page); -add_page_to_lru_list (page, lruvec); +lruvec_add_folio (lruvec,page_folio (page));__count_vm_events (PGDEACTIVATE , nr_pages); __count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE,
@@ -592,7 +592,7 @@ static void lru_lazyfree_fn(struct page *page, struct lruvec *lruvec)* anonymous pages */ ClearPageSwapBacked (page); -add_page_to_lru_list (page, lruvec); +lruvec_add_folio (lruvec,page_folio (page));__count_vm_events (PGLAZYFREE , nr_pages); __count_memcg_events(lruvec_memcg(lruvec), PGLAZYFREE,
mm/vmscan.c +2 -2
@@ -2354,7 +2354,7 @@ static unsigned int move_pages_to_lru(struct lruvec *lruvec,* inhibits memcg migration). */ VM_BUG_ON_PAGE (!folio_matches_lruvec (page_folio (page), lruvec), page); -add_page_to_lru_list (page, lruvec); +lruvec_add_folio (lruvec,page_folio (page)); nr_pages =thp_nr_pages (page); nr_moved += nr_pages;if (PageActive (page))
@@ -4875,7 +4875,7 @@ void check_move_unevictable_pages(struct pagevec *pvec)if (page_evictable (page) &&PageUnevictable (page)) {del_page_from_lru_list (page, lruvec);ClearPageUnevictable (page); -add_page_to_lru_list (page, lruvec); +lruvec_add_folio (lruvec,page_folio (page)); pgrescued += nr_pages; }SetPageLRU (page);
Signature · 1 line
2.25.1
PATCH 4/5 mm: remove add_page_to_lru_list_tail()
In reply to [email protected]From: Alex Shi <[email protected]>
The function could be fully replaced by lruvec_add_folio_tail, no reason to keep a duplicate one.
--- include/linux/mm_inline.h | 6 ------ mm/swap.c | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-)
include/linux/mm_inline.h +0 -6
@@ -102,12 +102,6 @@ void lruvec_add_folio_tail(struct lruvec *lruvec, struct folio *folio)list_add_tail (&folio->lru, &lruvec->lists[lru]); } -static __always_inline void add_page_to_lru_list_tail(struct page *page, -struct lruvec *lruvec) -{ -lruvec_add_folio_tail (lruvec,page_folio (page)); -} -static __always_inline void lruvec_del_folio(struct lruvec *lruvec, struct folio *folio) {
mm/swap.c +1 -1
@@ -550,7 +550,7 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec)* The page's writeback ends up during pagevec * We move that page into tail of inactive. */ -add_page_to_lru_list_tail (page, lruvec); +lruvec_add_folio_tail (lruvec,page_folio (page));__count_vm_events (PGROTATED , nr_pages); }
Signature · 1 line
2.25.1
PATCH 5/5 mm: remove del_page_from_lru_list()
In reply to [email protected]From: Alex Shi <[email protected]>
The function could be fully replaced by lruvec_del_folio(), no reason to keep a duplicate one.
--- include/linux/mm_inline.h | 6 ------ mm/compaction.c | 2 +- mm/mlock.c | 2 +- mm/swap.c | 10 +++++----- mm/vmscan.c | 4 ++-- 5 files changed, 9 insertions(+), 15 deletions(-)
include/linux/mm_inline.h +0 -6
@@ -110,12 +110,6 @@ void lruvec_del_folio(struct lruvec *lruvec, struct folio *folio) -folio_nr_pages(folio)); } -static __always_inline void del_page_from_lru_list(struct page *page, -struct lruvec *lruvec) -{ -lruvec_del_folio (lruvec,page_folio (page)); -} -#ifdef CONFIG_ANON_VMA_NAME /* * mmap_lock should be read-locked when calling vma_anon_name() and while using
mm/compaction.c +1 -1
@@ -1064,7 +1064,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, low_pfn +=compound_nr (page) -1 ;/* Successfully isolated */ -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));mod_node_page_state (page_pgdat (page),NR_ISOLATED_ANON +folio_is_file_lru (page_folio (page)),thp_nr_pages (page));
mm/mlock.c +1 -1
@@ -280,7 +280,7 @@ static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone)*/ if (TestClearPageLRU (page)) { lruvec =folio_lruvec_relock_irq (folio, lruvec); -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));continue ; }else __munlock_isolation_failed (page);
mm/swap.c +5 -5
@@ -85,7 +85,7 @@ static void __page_cache_release(struct page *page)unsigned long flags; lruvec =folio_lruvec_lock_irqsave (folio, &flags); -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));__folio_clear_lru_flags (page_folio (page));unlock_page_lruvec_irqrestore (lruvec, flags); }
@@ -533,7 +533,7 @@ static void lru_deactivate_file_fn(struct page *page, struct lruvec *lruvec)if (page_mapped (page))return ; -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));ClearPageActive (page);ClearPageReferenced (page);
@@ -566,7 +566,7 @@ static void lru_deactivate_fn(struct page *page, struct lruvec *lruvec)if (PageActive (page) && !PageUnevictable (page)) {int nr_pages =thp_nr_pages (page); -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));ClearPageActive (page);ClearPageReferenced (page);lruvec_add_folio (lruvec,page_folio (page));
@@ -583,7 +583,7 @@ static void lru_lazyfree_fn(struct page *page, struct lruvec *lruvec) !PageSwapCache(page) && !PageUnevictable(page)) {int nr_pages =thp_nr_pages (page); -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));ClearPageActive (page);ClearPageReferenced (page);/*
@@ -965,7 +965,7 @@ void release_pages(struct page **pages, int nr)if (prev_lruvec != lruvec) lock_batch =0 ; -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));__folio_clear_lru_flags (page_folio (page)); }
mm/vmscan.c +2 -2
@@ -2247,7 +2247,7 @@ int isolate_lru_page(struct page *page)get_page (page); lruvec =folio_lruvec_lock_irq (folio); -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));unlock_page_lruvec_irq (lruvec); ret =0 ; }
@@ -4873,7 +4873,7 @@ void check_move_unevictable_pages(struct pagevec *pvec) lruvec =folio_lruvec_relock_irq (folio, lruvec);if (page_evictable (page) &&PageUnevictable (page)) { -del_page_from_lru_list (page, lruvec); +lruvec_del_folio (lruvec,page_folio (page));ClearPageUnevictable (page);lruvec_add_folio (lruvec,page_folio (page)); pgrescued += nr_pages;
Signature · 1 line
2.25.1