[Devel] [PATCH RH8 2/2] oom: Initialize oom_rage_lock spinlock

Evgenii Shatokhin eshatokhin at virtuozzo.com
Wed Jul 28 20:23:54 MSK 2021


Lockdep complained about it as follows:
------------
kernel: Memory cgroup out of memory: Killed process 2053 (exec_wrap)
   VE "101" total-vm:70964kB, anon-rss:836kB, file-rss:5884kB,
   shmem-rss:0kB, UID:0
kernel: INFO: trying to register non-static key.
kernel: the code is fine but needs lockdep annotation.
kernel: turning off the locking correctness validator.
kernel: CPU: 1 PID: 3544 Comm: python ve: 101
  Tainted: G        W        --------- -  - 4.18.0-240.1.1.vz8.5.60+debug
kernel: Hardware name: Virtuozzo KVM, BIOS 1.11.0-2.vz7.2 04/01/2014
kernel: Call Trace:
kernel:  dump_stack+0x9a/0xf0
kernel:  register_lock_class+0x148c/0x17e0
kernel:  __lock_acquire+0x104/0x7300
kernel:  lock_acquire+0x14f/0x3b0
kernel:  _raw_spin_lock+0x30/0x70
kernel:  oom_berserker+0xd4/0x370
[...]
------------

Done in the scope of https://jira.sw.ru/browse/PSBM-131983.

Fixes: 8132f6df9b22 "oom: resurrect berserker mode"
Signed-off-by: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
---
 mm/memcontrol.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4638d9fe1ebf..f9a1c3c4f85e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5949,6 +5949,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
 		goto fail;
 
 	INIT_WORK(&memcg->high_work, high_work_func);
+	spin_lock_init(&memcg->oom_rage_lock);
 	INIT_LIST_HEAD(&memcg->oom_notify);
 	mutex_init(&memcg->thresholds_lock);
 	spin_lock_init(&memcg->move_lock);
-- 
2.29.0



More information about the Devel mailing list