lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220120131024.502877-3-alexs@kernel.org>
Date:   Thu, 20 Jan 2022 21:10:21 +0800
From:   alexs@...nel.org
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Alex Shi <alexs@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
        Ingo Molnar <mingo@...hat.com>,
        Naoya Horiguchi <naoya.horiguchi@....com>,
        Yu Zhao <yuzhao@...gle.com>, Arnd Bergmann <arnd@...db.de>,
        Vlastimil Babka <vbabka@...e.cz>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Johannes Weiner <hannes@...xchg.org>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH 2/5] mm: remove __clear_page_lru_flags()

From: Alex Shi <alexs@...nel.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@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Yu Zhao <yuzhao@...gle.com>
Cc: Alex Shi <alexs@...nel.org>
Cc: Vlastimil Babka <vbabka@...e.cz>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org
---
 include/linux/mm_inline.h | 5 -----
 mm/swap.c                 | 4 ++--
 mm/vmscan.c               | 2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)

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);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ