Skip to contentSkip to conversation

memcg-oom-notify-on-oom-killer-invocation-from-the-charge-path.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jan 2, 2019 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: memcg, oom: notify on oom killer invocation from the charge path
has been removed from the -mm tree. Its filename was
memcg-oom-notify-on-oom-killer-invocation-from-the-charge-path.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Michal Hocko <[email protected]>
Subject: memcg, oom: notify on oom killer invocation from the charge path

Burt Holzman has noticed that memcg v1 doesn't notify about OOM events via eventfd anymore. The reason is that 29ef680ae7c2 ("memcg, oom: move out_of_memory back to the charge path") has moved the oom handling back to the charge path. While doing so the notification was left behind in mem_cgroup_oom_synchronize.

Fix the issue by replicating the oom hierarchy locking and the notification.

Fixes 29ef680ae7c2 ("memcg, oom: move out_of_memory back to the charge path")
Cc Vladimir Davydov <[email protected]
Cc <[email protected]> [4.19+]

---

mm/memcontrol.c renamed from mm/memcontrol.c~memcg-oom-notify-on-oom-killer-invocation-from-the-charge-path +18 -2
@@ -1673,6 +1673,9 @@ enum oom_status {
 
 static enum oom_status mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order)
 {
+	enum oom_status ret;
+	bool locked;
+
 	if (order > PAGE_ALLOC_COSTLY_ORDER)
 		return OOM_SKIPPED;
 
@@ -1707,10 +1710,23 @@ static enum oom_status mem_cgroup_oom(st
 		return OOM_ASYNC;
 	}
 
+	mem_cgroup_mark_under_oom(memcg);
+
+	locked = mem_cgroup_oom_trylock(memcg);
+
+	if (locked)
+		mem_cgroup_oom_notify(memcg);
+
+	mem_cgroup_unmark_under_oom(memcg);
 	if (mem_cgroup_out_of_memory(memcg, mask, order))
-		return OOM_SUCCESS;
+		ret = OOM_SUCCESS;
+	else
+		ret = OOM_FAILED;
+
+	if (locked)
+		mem_cgroup_oom_unlock(memcg);
 
-	return OOM_FAILED;
+	return ret;
 }
 
 /**

_

Patches currently in -mm which might be from [email protected] are

mm-memcg-fix-reclaim-deadlock-with-writeback.patch