From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua0-f197.google.com (mail-ua0-f197.google.com [209.85.217.197]) by kanga.kvack.org (Postfix) with ESMTP id 67EC56B0005 for ; Wed, 2 May 2018 11:47:58 -0400 (EDT) Received: by mail-ua0-f197.google.com with SMTP id t46so4063508uad.3 for ; Wed, 02 May 2018 08:47:58 -0700 (PDT) Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com. [67.231.145.42]) by mx.google.com with ESMTPS id c4si459851uaa.240.2018.05.02.08.47.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 08:47:57 -0700 (PDT) From: Roman Gushchin Subject: [PATCH v2 RESEND 2/2] mm: ignore memory.min of abandoned memory cgroups Date: Wed, 2 May 2018 16:47:10 +0100 Message-ID: <20180502154710.18737-2-guro@fb.com> In-Reply-To: <20180502154710.18737-1-guro@fb.com> References: <20180502154710.18737-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, Roman Gushchin , Johannes Weiner , Michal Hocko , Vladimir Davydov , Tejun Heo 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 Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Tejun Heo Acked-by: Johannes Weiner --- 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