Re: [PATCH v5 2/3] mm/vmscan: add pgrotate_anon and pgrotate_file vmstat counters

From: Vlastimil Babka (SUSE)

Date: Tue Aug 04 2026 - 11:36:21 EST


On 7/27/26 18:23, Usama Arif wrote:
> Reclaim can spend substantial work on an LRU type without immediately
> reclaiming or demoting a corresponding amount of memory. Record this
> work in PGROTATE_ANON and PGROTATE_FILE.
>
> For classic LRU reclaim:
>
> - Inactive-list reclaim adds nr_scanned - nr_reclaimed to the
> corresponding anon/file counter when isolation succeeds.
> - Active-list reclaim adds referenced executable file folios that
> are retained on the active list to PGROTATE_FILE. Active anon
> reclaim does not contribute this component.
>
> For MGLRU, add the number of initially isolated pages that remain
> unreclaimed after both the initial and retry passes to the counter for
> the selected anon/file type.
>
> These counters are distinct from the existing pgrotated vm event.
> pgrotated records an actual move to the inactive-list tail, primarily
> after reclaim-marked writeback completes or failed invalidation leaves
> a folio for accelerated reclaim. PGROTATE_ANON and PGROTATE_FILE
> measure reclaim cost and do not imply that a folio moved to an LRU tail.
>
> A subsequent patch will consume these counters for anon/file scan
> balancing.
>
> Signed-off-by: Usama Arif <usama.arif@xxxxxxxxx>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>