Svyatko
February 15, 2026, 9:22am
1
Multi-Gen LRU
The multi-gen LRU is an alternative LRU implementation that optimizes page reclaim and improves performance under memory pressure. Page reclaim decides the kernel’s caching policy and ability to overcommit memory. It directly impacts the kswapd CPU usage and RAM efficiency.
https://docs.kernel.org/admin-guide/mm/multigen_lru.html
https://www.kernel.org/doc/html//v6.19/mm/multigen_lru.html
Phoronix: https://www.phoronix.com/search/MGLRU
I asked for unblocking MLGRU with Bug 1258204 and Bug 1258205 .
Previously devs rejected le9 patch: Bug 1188861
News: https://www.phoronix.com/scan.php?page=news_item&px=le9-Linux-Low-RAM
According to the Phoronix reader involved with the Le9 work, he’s reportedly able to run Mozilla Firefox with 37 tabs as well as having Skype, Discord, two PDFs, and LibreOffice all running on an ageing decade old system with just 2GB of RAM.
Protection of clean file pages (page cache) may be used to prevent thrashing, reducing I/O under memory pressure, avoid high latency and prevent livelock in near-OOM conditions…
Info and tests from Phoronix: https://www.phoronix.com/search/MGLRU
Tests for le9 patch:
https://notes.valdikss.org.ru/linux-for-old-pc-from-2007/en/
Not sure why the bug reports, just enable it?
Leap 16.0
cat /etc/systemd/system/mglru.service
## /etc/systemd/system/mglru.service
## <https://docs.kernel.org/admin-guide/mm/multigen_lru.html>
[Unit]
Description=Multi-Gen LRU Enable Service
ConditionPathExists=/sys/kernel/mm/lru_gen/enabled
[Service]
Type=oneshot
## Turn on MGLRU, valid values: [0; 7] and [yYnN]
## Enable all
ExecStart=/usr/bin/bash -c "/bin/echo y > /sys/kernel/mm/lru_gen/enabled"
## Set the thrashing prevention vaule in milliseconds, valid values: >= 0
ExecStartPost=/usr/bin/bash -c "/bin/echo 1000 > /sys/kernel/mm/lru_gen/min_ttl_ms"
[Install]
WantedBy=default.target
systemctl status mglru.service
○ mglru.service - Multi-Gen LRU Enable Service
Loaded: loaded (/etc/systemd/system/mglru.service; enabled; preset: disabled)
Active: inactive (dead) since Sun 2026-02-15 12:33:40 CST; 4min 40s ago
Invocation: d76580b273ab4c6e8ee11d4cb67660ca
Process: 1061 ExecStart=/usr/bin/bash -c /bin/echo y > /sys/kernel/mm/lru_gen/enabled (code=exited, status=0/SUCCESS)
Process: 1100 ExecStartPost=/usr/bin/bash -c /bin/echo 1000 > /sys/kernel/mm/lru_gen/min_ttl_ms (code=exited, status=0/SUCCESS)
Main PID: 1061 (code=exited, status=0/SUCCESS)
CPU: 26ms
Feb 15 12:33:40 systemd[1]: Starting Multi-Gen LRU Enable Service...
Feb 15 12:33:40 systemd[1]: mglru.service: Deactivated successfully.
Feb 15 12:33:40 systemd[1]: Finished Multi-Gen LRU Enable Service.
cat /sys/kernel/mm/lru_gen/enabled
0x0007
cat /sys/kernel/mm/lru_gen/min_ttl_ms
1000
The same works in Tumbleweed…
Svyatko
February 16, 2026, 3:48am
4
This
CONFIG_LRU_GEN_ENABLED=y
– what this is for?
I didn’t understand how to turn it on, will test further.
OpenSUSE prefer to use Linux kernel with MGLRU being available, but not enabled by default?
I tried
:~> sudo y > /sys/kernel/mm/lru_gen/enabled
, but this doesn’t work.
After
:~> su -l
I can change values:
:~ # echo 5 >/sys/kernel/mm/lru_gen/enabled
:~ # cat /sys/kernel/mm/lru_gen/enabled
0x0005
MGLRU helper:
Control the state of MGLRU
@Svyatko Yes, enabled in this case means available for system use. Just not activated which AFAIK is the second config option. That is left to the end user to decide the settings required.
You didn’t use the echo in that first command?
Svyatko
February 16, 2026, 4:09am
6
sudo echo 5 > /sys/kernel/mm/lru_gen/enabled
also doesn’t work.
rawar
February 16, 2026, 9:16am
7
sudo bash -c 'echo y > /sys/kernel/mm/lru_gen/enabled'
Svyatko
February 16, 2026, 11:33am
8
Running bash instead of command inside bash? OK.
It works.
MGLRU works for Leap 15.6 and 16.0 after manual enabling.
I created systemd script to set parameters on boot.
Now I have next question:
Zswap and MGLRU are usable for Leap 15.6 and 16.0 after manual enabling.
There are some parameters for zswap and for MGLRU. How to properly tune zswap with MGLRU to make them work together properly?
Zswap enlarges available memory (well, not memory, but caches), MGLRU prevents thrashing .
There are 3 technologies for extending RAM: zRam, zswap, zcache.
I’m using zswap because I need swap because examined system has only 2 GiB of RAM.
ILL zcache is the best among these three, but it is abando…