Re: [PATCH v3] mm/mglru: fix a no-op lru_gen_clear_refs() call in lru_lazyfree()

From: Bo Zhang

Date: Tue Nov 10 2026 - 20:48:53 EST


On Mon, Nov 9, 2026 at 1:08 PM Barry Song <baohua@xxxxxxxxxx> wrote:
> However, real-world workload data would be helpful
> to demonstrate the actual performance impact and make
> the case more convincing.
>
> The patch itself makes a lot of sense in theory, though.
>
> I'll arrange some tests with Android workloads and report
> back once the data is available. If Hui already has some
> data, it would be great if he could share it as well.

Tested on a Xiaomi phone (android16-6.12 GKI with this fix backported,
MGLRU enabled). The workload launches and scrolls 26 common apps for
5 rounds; each run produces ~7-9M MADV_FREE pages. 3 runs per kernel,
same system image, same sequence (fresh boot, then back-to-back), only
the kernel differs:

without fix with fix
workingset_refault_file 44.7M 29.0M (-35%)
pgmajfault 13.9M 9.0M (-35%)
pgsteal (kswapd+direct) 100.9M 75.6M (-25%)
cold launch (avg) 2436ms 2034ms (-17%)

Without the fix, lazyfree folios keep their stale refs/PG_workingset
and get protected instead of evicted. Since they sit on the file LRU,
page cache is reclaimed in their place, which shows up as more file
refaults and major faults.

Tested-by: Bo Zhang <zhangbo56@xxxxxxxxxx>