Re: [PATCH 4/6] mm/mglru: exclude folios promoted by aging from protected in inc_min_seq()
From: Baoquan He
Date: Wed Aug 26 2026 - 04:58:15 EST
On 08/21/26 at 06:25pm, Barry Song (Xiaomi) wrote:
> Some folios may have been promoted during aging, so don't count them
> as protected, similar to sort_folio().
Makes sense, the change makes it consistent with sort_filio.
Reviewed-by: Baoquan He <baoquan.he@xxxxxxxxx>
>
> Signed-off-by: Barry Song (Xiaomi) <baohua@xxxxxxxxxx>
> ---
> mm/vmscan.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 3b618a51cde2..7bd01875fade 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -3949,16 +3949,15 @@ static bool inc_min_seq(struct lruvec *lruvec, int type, int swappiness)
> if (gen_increased) {
> delta += nr_pages;
> list_move_tail(&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);
> +
> + protected[tier] += nr_pages;
> + }
> } 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);
> -
> - protected[tier] += nr_pages;
> - }
> -
> if (!--remaining)
> break;
> }
> --
> 2.34.1
>