Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908512 - Enable multi-gen LRU by default
Summary: Enable multi-gen LRU by default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-15 04:59 UTC by Yu Zhao
Modified: 2023-07-06 07:41 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yu Zhao 2023-06-15 04:59:23 UTC
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.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-15 16:49:36 UTC
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.
Comment 2 Yu Zhao 2023-06-18 23:37:52 UTC
Thank you.

One of our team members (tzungbi@google.com) will be sending you a PR.

Anything else please feel free to tag me.
Comment 3 Tzung-Bi Shih 2023-06-20 00:27:48 UTC
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)
Comment 4 Tzung-Bi Shih 2023-06-20 00:31:14 UTC
(In reply to Tzung-Bi Shih from comment #3)
> Hi Same,

I am sorry for typo your name.
Comment 5 Yu Zhao 2023-06-27 19:14:12 UTC
Gentle ping. Thank you.
Comment 6 Larry the Git Cow gentoo-dev 2023-06-28 15:10:09 UTC
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(+)
Comment 7 Yu Zhao 2023-06-28 20:15:10 UTC
Thanks for the PR, Ben!
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-05 18:42:44 UTC
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!
Comment 9 Yu Zhao 2023-07-05 19:02:28 UTC
Thanks, Sam.

If there are any bugs that might be related to MGLRU, please feel free to assign them to me.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-06 07:41:38 UTC
(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!