freenode
Kernel & Low-Level

MGLRU gains frequency-guided promotion in v4 patch series

Kairui Song’s Multi-Gen LRU work promotes hot pages on access rather than waiting for eviction feedback, cutting I/O and reclaim pressure on many workloads.

Kairui Song has posted version 4 of a Multi-Gen LRU (MGLRU) series that adds frequency-guided promotion and cleans up how access history is stored in page flags. The work is out of RFC, has drawn broadly positive review, and has been exercised on desktops, large servers, Android, and both x86_64 and arm64, with reported gains on the order of 10-40% less I/O or better runtime for many workloads while freeing one page-flag bit.

MGLRU already protected hot pages at eviction time via a tiered PID-style controller. That design left a long feedback loop: pages could be thrown out before protection engaged, tier resolution was coarse once access counts saturated, and protecting cold tail pages could starve hotter head pages. Frequency-guided promotion instead tracks a per-folio access count in the flags and promotes pages proactively once they cross defined thresholds, rather than waiting for reclaim to notice refaults.

The same count now absorbs the old workingset and referenced bits, so MGLRU needs one fewer flag bit for a maximum of seven access levels and keeps a cleaner distinction between cold, workingset, and protected pages. Classical LRU is untouched. Side effects called out in the cover letter include more accurate PSI workingset accounting and better page-cache tracking, plus smoother active/inactive stats that no longer jump or reverse under swapless aging.

Kernel build tests in a tight memcg with ZRAM or disk swap show lower page-in, swap, and refault counts than both classical LRU and prior MGLRU, with earlier disk-swap regressions gone. Song frames the series as a pure gain that blocks nothing and as the practical follow-through to ideas aired at LSF/MM/BPF.