Re: [PATCH v3 1/7] mm/mglru: separate folio generation update from LRU accounting
From: Baolin Wang
Date: Thu Sep 03 2026 - 05:43:16 EST
On 9/2/26 7:24 AM, Barry Song (Xiaomi) wrote:
folio_inc_gen() currently updates both the folio's generation and the
LRU size accounting. This makes it difficult to batch the LRU size updates
when moving multiple folios.
Extract the generation update into __folio_inc_gen(), which only updates
the folio's generation and reports whether the generation was actually
increased. Keep folio_inc_gen() as the wrapper that performs the LRU size
accounting when needed.
This separates the per-folio generation update from LRU accounting and
allows the latter to be batched by subsequent changes.
Signed-off-by: Barry Song (Xiaomi) <baohua@xxxxxxxxxx>
Tested-by: Xueyuan Chen <xueyuan.chen21@xxxxxxxxx>
Reviewed-by: Lian Wang <lianux.mm@xxxxxxxxx>
---
LGTM.
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>