Skip to contentSkip to conversation

mm-mglru-make-lru-folio-prefetch-helper-an-inline-function.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 7

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/mglru: make LRU folio prefetch helper an inline function
has been removed from the -mm tree. Its filename was
mm-mglru-make-lru-folio-prefetch-helper-an-inline-function.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Barry Song (Xiaomi)" <[email protected]>
Subject: mm/mglru: make LRU folio prefetch helper an inline function
Date: Wed, 2 Sep 2026 07:24:19 +0800

prefetchw_prev_lru_folio() is currently implemented as a macro with a potentially unused argument. This makes the helper harder to read and can also trigger checkpatch warnings about unused macro arguments.

Make it a static inline function and remove the unnecessary _field argument. The helper always prefetches the previous folio's flags, so there is no need to make the field configurable.

Cc Axel Rasmussen <[email protected]>
Cc Baoquan He <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc David Stevens <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Kairui Song <[email protected]>
Cc Kunwu Chan <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Ridong Chen <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yuanchu Xie <[email protected]>

---

 mm/vmscan.c |   26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
mm/vmscan.c renamed from mm/vmscan.c~mm-mglru-make-lru-folio-prefetch-helper-an-inline-function +15 -11
@@ -182,17 +182,21 @@ struct scan_control {
 };
 
 #ifdef ARCH_HAS_PREFETCHW
-#define prefetchw_prev_lru_folio(_folio, _base, _field)			\
-	do {								\
-		if ((_folio)->lru.prev != _base) {			\
-			struct folio *prev;				\
-									\
-			prev = lru_to_folio(&(_folio->lru));		\
-			prefetchw(&prev->_field);			\
-		}							\
-	} while (0)
+static inline void prefetchw_prev_lru_folio(struct folio *folio,
+		struct list_head *base)
+{
+	if (folio->lru.prev != base) {
+		struct folio *prev;
+
+		prev = lru_to_folio(&folio->lru);
+		prefetchw(&prev->flags);
+	}
+}
 #else
-#define prefetchw_prev_lru_folio(_folio, _base, _field) do { } while (0)
+static inline void prefetchw_prev_lru_folio(struct folio *folio,
+		struct list_head *base)
+{
+}
 #endif
 
 /*
@@ -1700,7 +1704,7 @@ static unsigned long isolate_lru_folios(
 		struct folio *folio;
 
 		folio = lru_to_folio(src);
-		prefetchw_prev_lru_folio(folio, src, flags);
+		prefetchw_prev_lru_folio(folio, src);
 
 		nr_pages = folio_nr_pages(folio);
 		total_scan += nr_pages;

_

Patches currently in -mm which might be from [email protected] are

mm-mglru-restore-accidentally-removed-seq-max_seq-check.patch