https://dev.to/archerallstars/enable-th ... -today-ji6
https://docs.kernel.org/admin-guide/mm/ ... n_lru.html
https://github.com/hakavlad/mg-lru-help ... /README.md
It seems to be included in Kernel but not enabled (and its "stats"):
grep -Ria CONFIG_LRU_GEN /boot
Off Topic
/boot/config-6.1.0-27-amd64:CONFIG_LRU_GEN=y
/boot/config-6.1.0-27-amd64:# CONFIG_LRU_GEN_ENABLED is not set
/boot/config-6.1.0-27-amd64:# CONFIG_LRU_GEN_STATS is not set
/boot/config-6.1.0-26-amd64:CONFIG_LRU_GEN=y
/boot/config-6.1.0-26-amd64:# CONFIG_LRU_GEN_ENABLED is not set
/boot/config-6.1.0-26-amd64:# CONFIG_LRU_GEN_STATS is not set
/boot/config-6.1.0-27-amd64:# CONFIG_LRU_GEN_ENABLED is not set
/boot/config-6.1.0-27-amd64:# CONFIG_LRU_GEN_STATS is not set
/boot/config-6.1.0-26-amd64:CONFIG_LRU_GEN=y
/boot/config-6.1.0-26-amd64:# CONFIG_LRU_GEN_ENABLED is not set
/boot/config-6.1.0-26-amd64:# CONFIG_LRU_GEN_STATS is not set
So I did it (possibly wrong) like this:
echo 'GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} mglru.enabled=1"'|sudo tee /etc/default/grub.d/mglru.cfg && sudo update-grub
Off Topic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.1.0-27-amd64
Found initrd image: /boot/initrd.img-6.1.0-27-amd64
Found linux image: /boot/vmlinuz-6.1.0-26-amd64
Found initrd image: /boot/initrd.img-6.1.0-26-amd64
Found linux image: /boot/vmlinuz-6.1.0-27-amd64
Found initrd image: /boot/initrd.img-6.1.0-27-amd64
Found linux image: /boot/vmlinuz-6.1.0-26-amd64
Found initrd image: /boot/initrd.img-6.1.0-26-amd64
Adding boot menu entry for UEFI Firmware Settings ...
done
Found linux image: /boot/vmlinuz-6.1.0-27-amd64
Found initrd image: /boot/initrd.img-6.1.0-27-amd64
Found linux image: /boot/vmlinuz-6.1.0-26-amd64
Found initrd image: /boot/initrd.img-6.1.0-26-amd64
Found linux image: /boot/vmlinuz-6.1.0-27-amd64
Found initrd image: /boot/initrd.img-6.1.0-27-amd64
Found linux image: /boot/vmlinuz-6.1.0-26-amd64
Found initrd image: /boot/initrd.img-6.1.0-26-amd64
Adding boot menu entry for UEFI Firmware Settings ...
done
Off Topic
linux /vmlinuz-6.1.0-27-amd64 root=/dev/mapper/hn--vg-root ro quiet
linux /vmlinuz-6.1.0-27-amd64 root=/dev/mapper/hn--vg-root ro single
linux /vmlinuz-6.1.0-26-amd64 root=/dev/mapper/hn--vg-root ro quiet mglru.enabled=1
linux /vmlinuz-6.1.0-26-amd64 root=/dev/mapper/hn--vg-root ro single
linux /vmlinuz-5.10.0-20-amd64 root=/dev/mapper/hn--vg-root ro quiet
linux /vmlinuz-6.1.0-27-amd64 root=/dev/mapper/hn--vg-root ro single
linux /vmlinuz-6.1.0-26-amd64 root=/dev/mapper/hn--vg-root ro quiet mglru.enabled=1
linux /vmlinuz-6.1.0-26-amd64 root=/dev/mapper/hn--vg-root ro single
linux /vmlinuz-5.10.0-20-amd64 root=/dev/mapper/hn--vg-root ro quiet
Off Topic
${GRUB_CMDLINE_LINUX_DEFAULT} mglru.enabled=1
$GRUB_CMDLINE_LINUX_DEFAULT mglru.enabled=1
mglru.enabled=1
$GRUB_CMDLINE_LINUX_DEFAULT mglru.enabled=1
mglru.enabled=1
This seems to enable it at least for the session during runtime:
echo y|sudo tee /sys/kernel/mm/lru_gen/enabled
y
cat /sys/kernel/mm/lru_gen/enabled
0x0007