v6.1 and later kernels support multi-gen LRU (MGLRU) [1]. It can be enabled by the following configurations [2]. CONFIG_LRU_GEN=y CONFIG_LRU_GEN_ENABLED=y [1] https://docs.kernel.org/mm/multigen_lru.html [2] https://docs.kernel.org/admin-guide/mm/multigen_lru.html Benchmark results look very promising [3][4][5][6][7]. [3] https://www.phoronix.com/news/MGLRU-Reaches-mm-stable [4] https://www.phoronix.com/news/MGLRU-July-2022-Performance [5] https://openbenchmarking.org/result/2206304-NE-5500UMGLR70 [6] https://openbenchmarking.org/result/2207073-NE-RYZEN748095 [7] https://openbenchmarking.org/result/2209259-PTS-MGLRU8GB57 Fedora [8] and Archlinux [9] both have been on MGLRU since v6.1. Debian [10] and Ubuntu [11] also plan to enable MGLRU. [8] https://koji.fedoraproject.org/koji/buildinfo?buildID=2168435 [9] https://archlinux.org/packages/core/x86_64/linux-lts/ [10] https://salsa.debian.org/kernel-team/linux/-/merge_requests/746 [11] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2023629 Is this something Gentoo amenable to as well? Thank you.
Looks like we have it on for dist kernels already (inherited via Fedora), so it's just about genkernel (and manual builds, but I don't know if this would be appropriate to enable on by default in genpatches). Fancy making a PR to toggle it? It sounds good to me.
Thank you. One of our team members (tzungbi@google.com) will be sending you a PR. Anything else please feel free to tag me.
Hi Same, Could you point me the code path you expect to change? IIUC, genkernel relies on: - Users to specify the configs. - Saved configs previously or defaults. IOW, unlike sys-kernel/gentoo-kernel (https://github.com/projg2/fedora-kernel-config-for-gentoo/blob/6.1.7-gentoo/kernel-x86_64-fedora.config), genkernel has no such file. > genkernel automates the kernel build process and assembles the initramfs, but does not generate a custom kernel configuration file. If a kernel configuration is not provided, genkernel will use a generic kernel configuration file which will produce a general purpose kernel suitable for daily usage (https://wiki.gentoo.org/wiki/Genkernel) > If it is the first time that genkernel is run with the new kernel sources, or if the previous result has not been saved, this file is substituted with a default configuration file that resides at usr/share/genkernel/arch/x86_64/generated-config where x86_64 is substituted with the actual architecture. (https://wiki.gentoo.org/wiki/Genkernel#Kernel_configuration_file)
(In reply to Tzung-Bi Shih from comment #3) > Hi Same, I am sorry for typo your name.
Gentle ping. Thank you.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=1a279fb3c8dde317da95cb394477ea9a961f8302 commit 1a279fb3c8dde317da95cb394477ea9a961f8302 Author: Ben Kohler <bkohler@gentoo.org> AuthorDate: 2023-06-28 15:09:22 +0000 Commit: Ben Kohler <bkohler@gentoo.org> CommitDate: 2023-06-28 15:09:22 +0000 defaults/kernel-generic-config: enable multi-gen LRU Bug: https://bugs.gentoo.org/908512 Signed-off-by: Ben Kohler <bkohler@gentoo.org> defaults/kernel-generic-config | 2 ++ 1 file changed, 2 insertions(+)
Thanks for the PR, Ben!
commit e01ec132717e83208d78eb8b81e00ddb0ef91f7b (HEAD -> master, origin/master, origin/HEAD) Author: Sam James <sam@gentoo.org> Date: Wed Jul 5 19:26:47 2023 +0100 sys-kernel/genkernel: add 4.3.5 Closes: https://bugs.gentoo.org/909650 Bug: https://bugs.gentoo.org/909722 Signed-off-by: Sam James <sam@gentoo.org> Thanks!
Thanks, Sam. If there are any bugs that might be related to MGLRU, please feel free to assign them to me.
(In reply to Yu Zhao from comment #9) > Thanks, Sam. > > If there are any bugs that might be related to MGLRU, please feel free to > assign them to me. Many thanks! I'm sure we won't get any though. Appreciate the heads up again!