On Tue, Nov 3, 2026 at 10:57 AM Ridong Chen <[email protected]> wrote: > > From: Ridong Chen <[email protected]> > > The number of pages of a given type in a generation is computed by > summing lrugen->nr_pages[gen][type][] over all zones and clamping each > per-zone counter to >= 0, since the counters are updated locklessly and > can transiently go negative. This loop is open-coded in > lruvec_evictable_size() and in the debugfs lru_gen output. > > Add lruvec_gen_size() to compute it from a seq, and convert both users. > Put it in mm/vmscan.h so that the vmscan tracepoints, which include that > header, can use it as well. > An upcoming tracepoint and the MGLRU swappiness rework will also use it. > > No functional change. > > Suggested-by: Barry Song <[email protected]> > Signed-off-by: Ridong Chen <[email protected]> > ---
Reviewed-by: Barry Song <[email protected]>
