From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by kanga.kvack.org (Postfix) with ESMTP id 5877F6B004D for ; Mon, 16 Jun 2014 15:55:09 -0400 (EDT) Received: by mail-wi0-f182.google.com with SMTP id bs8so4682015wib.3 for ; Mon, 16 Jun 2014 12:55:08 -0700 (PDT) Received: from zene.cmpxchg.org (zene.cmpxchg.org. [2a01:238:4224:fa00:ca1f:9ef3:caee:a2bd]) by mx.google.com with ESMTPS id k10si20809920wjf.110.2014.06.16.12.55.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Jun 2014 12:55:08 -0700 (PDT) From: Johannes Weiner Subject: [patch 05/12] mm: memcontrol: reclaim at least once for __GFP_NORETRY Date: Mon, 16 Jun 2014 15:54:25 -0400 Message-Id: <1402948472-8175-6-git-send-email-hannes@cmpxchg.org> In-Reply-To: <1402948472-8175-1-git-send-email-hannes@cmpxchg.org> References: <1402948472-8175-1-git-send-email-hannes@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Michal Hocko , Hugh Dickins , Tejun Heo , Vladimir Davydov , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Currently, __GFP_NORETRY tries charging once and gives up before even trying to reclaim. Bring the behavior on par with the page allocator and reclaim at least once before giving up. Signed-off-by: Johannes Weiner Acked-by: Michal Hocko --- mm/memcontrol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 52550bbff1ef..9c646b9b56f4 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2613,13 +2613,13 @@ retry: if (!(gfp_mask & __GFP_WAIT)) goto nomem; - if (gfp_mask & __GFP_NORETRY) - goto nomem; - nr_reclaimed = mem_cgroup_reclaim(mem_over_limit, gfp_mask, flags); if (mem_cgroup_margin(mem_over_limit) >= batch) goto retry; + + if (gfp_mask & __GFP_NORETRY) + goto nomem; /* * Even though the limit is exceeded at this point, reclaim * may have been able to free some pages. Retry the charge -- 2.0.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org