Re: [RFC PATCH v2 4/5] mm: mglru: run aging when pages are severely imbalanced across gens
From: Zicheng Wang
Date: Tue Jul 28 2026 - 08:38:43 EST
Hi Barry,
> The original code is a bit odd, as it compares a single young
> generation and a single old generation against the total, rather than
> comparing all young generations with all old generations.
>
> By comparing all young generations against all old generations, we no
> longer depend on the exact value of MIN_NR_GENS. The idea is to
> emulate inactive_is_low().
Makes sense, the inactive_is_low() framing fits.
One gap: inactive_is_low()'s ratio is dynamic calculated.
int_sqrt(10*1024) = 101 (ages only when inactive drops below ~1%),
while patch 4/5's fixed 4 ages once old falls under 20% of young.
It seems there will be considerable cost on big memcgs, or should
the ratio scale with size?
Looking forward to the perf data.
Thanks,
Zicheng