
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/ICI3RV ---------------------------------------------------------------------- This config enables a per-CPU cache (stock) for kernel memory (kmem) charge/uncharge operations. When multiple memory cgroups (memcgs) frequently charge/uncharge kernel memory, they may contend on atomic operations in shared parent memcgs, causing performance degradation. The per-CPU stock reduces contention by batching charges locally before flushing to the shared parent, improving scalability for high-frequency kmem allocations. Signed-off-by: Chen Ridong <chenridong@huawei.com> --- arch/arm64/configs/openeuler_defconfig | 1 + arch/x86/configs/openeuler_defconfig | 1 + init/Kconfig | 14 ++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index f048a1b098d1f..3c659f7ffe6da 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -167,6 +167,7 @@ CONFIG_MEMCG_MEMFS_INFO=y CONFIG_MEMCG_OOM_PRIORITY=y CONFIG_MEMCG_SWAP_QOS=y CONFIG_MEMCG_KMEM=y +CONFIG_MEMCG_KMEM_STOCK=y CONFIG_BLK_CGROUP=y CONFIG_CGROUP_WRITEBACK=y CONFIG_CGROUP_V1_WRITEBACK=y diff --git a/arch/x86/configs/openeuler_defconfig b/arch/x86/configs/openeuler_defconfig index b46394fa0f144..3cbae4c5f3902 100644 --- a/arch/x86/configs/openeuler_defconfig +++ b/arch/x86/configs/openeuler_defconfig @@ -186,6 +186,7 @@ CONFIG_MEMCG_MEMFS_INFO=y CONFIG_MEMCG_OOM_PRIORITY=y CONFIG_MEMCG_SWAP_QOS=y CONFIG_MEMCG_KMEM=y +CONFIG_MEMCG_KMEM_STOCK=y CONFIG_BLK_CGROUP=y CONFIG_CGROUP_WRITEBACK=y CONFIG_CGROUP_V1_WRITEBACK=y diff --git a/init/Kconfig b/init/Kconfig index 486f3a333f95b..c08649062bb6d 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1028,6 +1028,20 @@ config MEMCG_KMEM depends on MEMCG default y +config MEMCG_KMEM_STOCK + bool + depends on MEMCG_KMEM + default y + help + This option enables a per-CPU cache (stock) for kernel memory (kmem) + charge/uncharge operations. When multiple memory cgroups (memcgs) + frequently charge/uncharge kernel memory, they may contend on atomic + operations in shared parent memcgs, causing performance degradation. + + The per-CPU stock reduces contention by batching charges locally + before flushing to the shared parent, improving scalability for + high-frequency kmem allocations. + config BLK_CGROUP bool "IO controller" depends on BLOCK -- 2.34.1