From 796077ca159f81cc5b32f5426f7454a6b2e0761f Mon Sep 17 00:00:00 2001 From: Kaihao Bai Date: Fri, 27 Feb 2026 18:58:25 +0800 Subject: [PATCH] anolis: mm: fix the setting error of memcg min_cache_kbytes ANBZ: #30959 The input of this interface was incorrectly converted, resulting in an unreasonable settable value. Therefore, the constraint of this interface has been fixed to half of the memcg maximum value. Fixes: fa7026c33011 ("anolis: mm: support min_cache_kbytes control of mem_cgroup") Signed-off-by: Kaihao Bai --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 52c9d3332b4c..687dd0099292 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6605,7 +6605,7 @@ static int mem_cgroup_min_cache_write(struct cgroup_subsys_state *css, u64 max = READ_ONCE(memcg->memory.max); u64 min_cache_pages = val >> (PAGE_SHIFT - 10); - if ((val << 10) > max / 2) + if (max && (min_cache_pages > max / 2)) return -EINVAL; memcg->min_cache_pages = min_cache_pages; -- Gitee