mm-mglru-enhance-cold-hot-inversion-handling-in-inc_min_seq.patch removed from -mm tree
The quilt patch titled
Subject: mm/mglru: enhance cold/hot inversion handling in inc_min_seq()
has been removed from the -mm tree. Its filename was
mm-mglru-enhance-cold-hot-inversion-handling-in-inc_min_seq.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: enhance cold/hot inversion handling in inc_min_seq()
Date: Wed, 2 Sep 2026 07:24:17 +0800
During aging, a folio's generation may already have been updated by folio_update_gen(), even though it has not yet been moved to the corresponding generation list. Such folios are hotter than those already in that generation.
It makes sense for inc_min_seq() to increment the generation of folios that were never promoted during aging and move them to the tail of the new oldest generation. However, folios that were already promoted should instead be moved to the head of their updated generation, just as sort_folio() does in scan_folios().
Otherwise, promoted folios could end up behind folios that were never promoted, effectively inverting their hot/cold ordering.
---
mm/vmscan.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
mm/vmscan.c renamed from mm/vmscan.c~mm-mglru-enhance-cold-hot-inversion-handling-in-inc_min_seq +10 -2
@@ -3954,9 +3954,17 @@ static bool inc_min_seq(struct lruvec *lVM_WARN_ON_ONCE_FOLIO (folio_zonenum (folio) != zone, folio); new_gen =__folio_inc_gen (folio, old_gen, &gen_increased); -list_move_tail (&folio->lru, &lrugen->folios[new_gen][type][zone]); -if (gen_increased) +/* +* If gen_increased is false, this is a promotion. Put folios +* at the head of the promoted gen. Otherwise, put them at +* the tail of the second-oldest gen. +*/ +if (gen_increased) { delta += nr_pages; +list_move_tail (&folio->lru, &lrugen->folios[new_gen][type][zone]); + }else { +list_move (&folio->lru, &lrugen->folios[new_gen][type][zone]); + }/* don't count the workingset being lazily promoted */ if (refs + workingset !=BIT (LRU_REFS_WIDTH ) +1 ) {int tier =lru_tier_from_refs (refs, workingset);
_
Patches currently in -mm which might be from [email protected] are
mm-mglru-restore-accidentally-removed-seq-max_seq-check.patch