MGLRU Revved Once More For Promising Linux Performance Improvements

Written by Michael Larabel in Linux Kernel on 19 May 2022 at 05:30 AM EDT. 6 Comments
Multi-Gen LRU (MGLRU) remains a very promising effort for enhancing Linux system performance and particularly about providing a superior experience when the Linux kernel is dealing with system memory pressure. MGLRU v11 was posted this week while we await to see if it will be mainlined come the v5.19 merge window.

The MGLRU effort led by Google's Yu Zhao is about improving the Linux kernel's page reclamation code after they found it to be too expensive and making poor eviction choices. MGLRU has yielded very promising real-world benchmark results for furthering Linux's performance. There are wins reported for Cassandra, Hadooop, MySQL/MariaDB, Memcached, MongoDB, PostgreSQL, Redis, and improving the behavior in general for systems with limited RAM capacities or a lot of memory intense activities.

From mobile and embedded devices up through powerful servers, MGLRU is looking very impactful on Linux.

MGLRU is already shipping with Google Android devices and also patched into Google's Chrome OS kernel. Some downstream kernel flavors like XanMod, Liquorix, and Arch Linux Zen are also using this patch-set. Google has found MGLRU to be extremely worthwhile in their usage on Android and Chrome OS:
We've rolled out MGLRU to tens of millions of Chrome OS users and about a million Android users. Google's fleetwide profiling shows an overall 40% decrease in kswapd CPU usage, in addition to improvements in other UX metrics, e.g., an 85% decrease in the number of low-memory kills at the 75th percentile and an 18% decrease in app launch time at the 50th percentile.

The v11 re-base to the MGLRU patch series continues to carry this summary:

The facts are:
1. The independent lab results and the real-world applications indicate substantial improvements; there are no known regressions.
2. Thrashing prevention, working set estimation and proactive reclaim work out of the box; there are no equivalent solutions.
3. There is a lot of new code; no one has demonstrated smaller changes with similar effects.

Our options, accordingly, are:
1. Given the amount of evidence, the reported improvements will likely materialize for a wide range of workloads.
2. Gauging the interest from the past discussions, the new features will likely be put to use for both personal computers and data centers.
3. Based on Google's track record, the new code will likely be well maintained in the long term. It'd be more difficult if not impossible to achieve similar effects with other alternatives.

Linus Torvalds didn't want MGLRU for v5.18 to allow more time for testing so we'll see coming up if the work is now deemed ready for merging into v5.19.

See the v11 patch series to learn more about this exciting Multi-Gen LRU work by Google.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week