@@ -1358,6 +1358,10 @@ PAGE_SIZE multiple when read back.
The number of processes belonging to this cgroup
killed by any kind of OOM killer.
+ oom_kill_inherit
+ The number of processes belonging to this cgroup
+ killed by all Ancestral memcg's OOM killer.
+
oom_group_kill
The number of times a group OOM has occurred.
@@ -46,6 +46,7 @@ enum memcg_memory_event {
MEMCG_MAX,
MEMCG_OOM,
MEMCG_OOM_KILL,
+ MEMCG_OOM_INHERIT,
MEMCG_OOM_GROUP_KILL,
MEMCG_SWAP_HIGH,
MEMCG_SWAP_MAX,
@@ -2129,6 +2129,10 @@ struct mem_cgroup *mem_cgroup_get_oom_group(struct task_struct *victim,
if (memcg == oom_domain)
break;
+ /* we use oom.group's logic to update the OOM_INHERIT indicator,
+ * but OOM_INHERIT and oom.group are independent of each other.
+ */
+ memcg_memory_event(memcg, MEMCG_OOM_INHERIT);
}
if (oom_group)
@@ -6622,6 +6626,8 @@ static void __memory_events_show(struct seq_file *m, atomic_long_t *events)
seq_printf(m, "oom %lu\n", atomic_long_read(&events[MEMCG_OOM]));
seq_printf(m, "oom_kill %lu\n",
atomic_long_read(&events[MEMCG_OOM_KILL]));
+ seq_printf(m, "oom_kill_inherit %lu\n",
+ atomic_long_read(&events[MEMCG_OOM_INHERIT]));
seq_printf(m, "oom_group_kill %lu\n",
atomic_long_read(&events[MEMCG_OOM_GROUP_KILL]));
}