Re: [PATCH v2 1/3] mm/mglru: factor out lru_gen_seq_nr_pages()

From
Baolin Wang <baolin.wang@linux.alibaba.com>
Date
2026-09-14 07:09:41
Also in
linux-mm, lkml
Reply to
Ridong Chen, 2026-09-11

On 9/11/26 6:29 PM, Ridong Chen wrote:
From: Ridong Chen <redacted>

Both lruvec_evictable_size() and the debugfs lru_gen_seq_show() compute
the number of pages in a generation the same way: sum lrugen->nr_pages
over all zones for a given (gen, type) and clamp each term to >= 0.

Factor that out into lru_gen_seq_nr_pages() so the open-coded zone loop
lives in one place. No functional change.

A follow-up patch adds a tracepoint that needs the same per-generation
page count, and will reuse this helper instead of open-coding it again.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Ridong Chen <redacted>
---
LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Thread (19 messages) 19 messages, 4 authors, last reply 28d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help