MGLRU (Multi-Gen LRU) is unavailable for Leap, bug is reported

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

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/

MGLRU, not MLGRU.

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…

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:

@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?

sudo echo 5 > /sys/kernel/mm/lru_gen/enabled

also doesn’t work.

sudo bash -c 'echo y >  /sys/kernel/mm/lru_gen/enabled'

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: