From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khorenko Date: Fri, 21 Aug 2026 18:42:11 +0200 Subject: [Devel] [PATCH RHEL10 COMMIT] mm/oom: build the berserker mode only with CONFIG_MEMCG In-Reply-To: <20260821163718.187766-9-khorenko@virtuozzo.com> Message-ID: <202608211642.67LGgBdO666973@f0.sw.ru> List-Id: The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git after rh10-6.12.0-211.39.1.16.6.vz10 ------> commit 15359d8092f220b53802e9a86de7cf10b8acff1a Author: Eva Kurchatova Date: Fri Aug 21 18:36:54 2026 +0200 mm/oom: build the berserker mode only with CONFIG_MEMCG oom_berserker() works on the memory cgroup the OOM happened in: it takes memcg->oom_rage_lock, updates memcg->oom_time/oom_rage, falls back to root_mem_cgroup and calls task_in_mem_cgroup(). None of that exists when CONFIG_MEMCG is disabled: mm/oom_kill.c: error: 'root_mem_cgroup' undeclared mm/oom_kill.c: error: invalid use of undefined type 'struct mem_cgroup' Compile the function only when CONFIG_MEMCG is enabled and provide an empty stub otherwise: without a memory controller there is no per-cgroup OOM rate to get enraged about, and the caller stays unchanged. Fixes: 6517e9ae0449 ("oom: resurrect berserker mode") Feature: mm/oom: berserker mode https://virtuozzo.atlassian.net/browse/VSTOR-134732 Signed-off-by: Eva Kurchatova Signed-off-by: Konstantin Khorenko --- mm/oom_kill.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 1fd5f99ce3b92..5cf0fefade481 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -1047,6 +1047,7 @@ static int oom_kill_memcg_member(struct task_struct *task, void *message) /* * Kill more processes if oom happens too often in this context. */ +#ifdef CONFIG_MEMCG static void oom_berserker(struct oom_control *oc) { static DEFINE_RATELIMIT_STATE(berserker_rs, @@ -1150,6 +1151,9 @@ static void oom_berserker(struct oom_control *oc) pr_err("OOM killer in rage %d: %d tasks killed\n", rage, killed); } +#else +static inline void oom_berserker(struct oom_control *oc) { } +#endif /* CONFIG_MEMCG */ atomic_t global_oom = ATOMIC_INIT(0);