diff mbox series

[2/5] mm: remove __clear_page_lru_flags()

Message ID 20220120131024.502877-3-alexs@kernel.org (mailing list archive)
State New
Headers show
Series remove add/del page to lru functions | expand

Commit Message

alexs@kernel.org Jan. 20, 2022, 1:10 p.m. UTC
From: Alex Shi <alexs@kernel.org>

The function could be fully replaced by __folio_clear_lru_flags(), no
reason to keep a duplicate one.

Signed-off-by: Alex Shi <alexs@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Yu Zhao <yuzhao@google.com>
Cc: Alex Shi <alexs@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
---
 include/linux/mm_inline.h | 5 -----
 mm/swap.c                 | 4 ++--
 mm/vmscan.c               | 2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index f0aa34b0f2c4..c2384da888b4 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -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.
diff --git a/mm/swap.c b/mm/swap.c
index bcf3ac288b56..953cf8860542 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -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);
diff --git a/mm/vmscan.c b/mm/vmscan.c
index c361973774b4..59a52ba8b52a 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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);