[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180502154710.18737-2-guro@fb.com>
Date: Wed, 2 May 2018 16:47:10 +0100
From: Roman Gushchin <guro@...com>
To: <linux-mm@...ck.org>
CC: <linux-kernel@...r.kernel.org>, <kernel-team@...com>,
Roman Gushchin <guro@...com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.com>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Tejun Heo <tj@...nel.org>
Subject: [PATCH v2 RESEND 2/2] mm: ignore memory.min of abandoned memory cgroups
If a cgroup has no associated tasks, invoking the OOM killer
won't help release any memory, so respecting the memory.min
can lead to an infinite OOM loop or system stall.
Let's ignore memory.min of unpopulated cgroups.
Signed-off-by: Roman Gushchin <guro@...com>
Cc: Johannes Weiner <hannes@...xchg.org>
Cc: Michal Hocko <mhocko@...e.com>
Cc: Vladimir Davydov <vdavydov.dev@...il.com>
Cc: Tejun Heo <tj@...nel.org>
Acked-by: Johannes Weiner <hannes@...xchg.org>
---
mm/vmscan.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 50055d72f294..709237feddc1 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2549,8 +2549,11 @@ static bool shrink_node(pg_data_t *pgdat, struct scan_control *sc)
/*
* Hard protection.
* If there is no reclaimable memory, OOM.
+ * Abandoned cgroups are loosing protection,
+ * because OOM killer won't release any memory.
*/
- continue;
+ if (cgroup_is_populated(memcg->css.cgroup))
+ continue;
case MEMCG_PROT_LOW:
/*
* Soft protection.
--
2.14.3
Powered by blists - more mailing lists