Skip to contentSkip to conversation

mm-mglru-make-retry-logic-explicit-in-isolate_folios.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 retry logic explicit in isolate_folios()
has been removed from the -mm tree. Its filename was
mm-mglru-make-retry-logic-explicit-in-isolate_folios.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 retry logic explicit in isolate_folios()
Date: Sat, 29 Aug 2026 15:42:04 +0800

The existing mainline code retries the same type once in a rather subtle way. for_each_evictable_type() may provide one more iteration, allowing the same type to be retried if we scanned some folios but failed to isolate any due to protections, promotions, or races. This patch makes the retry behavior explicit.

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 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 |   10 ++++++++++
 1 file changed, 10 insertions(+)
mm/vmscan.c renamed from mm/vmscan.c~mm-mglru-make-retry-logic-explicit-in-isolate_folios +10 -0
@@ -4840,6 +4840,7 @@ static int isolate_folios(unsigned long
 	bool type_fallback_allowed = !is_single_type_reclaim(swappiness);
 	int type = get_type_to_scan(lruvec, swappiness);
 	int total_scanned = 0, scanned, tier;
+	bool tried = false;
 
 retry:
 	tier = get_tier_idx(lruvec, type);
@@ -4859,9 +4860,18 @@ retry:
 	 */
 	if (!scanned && type_fallback_allowed) {
 		type = !type;
+		tried = true;
 		type_fallback_allowed = false;
 		goto retry;
 	}
+	/*
+	 * We scanned some folios but failed to isolate any due to promotions,
+	 * protections, or races. Retry once to avoid a larger loop.
+	 */
+	if (scanned && !tried) {
+		tried = true;
+		goto retry;
+	}
 
 	return total_scanned;
 }

_

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

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