From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by kanga.kvack.org (Postfix) with ESMTP id 954A36B0031 for ; Tue, 17 Jun 2014 09:53:46 -0400 (EDT) Received: by mail-wi0-f176.google.com with SMTP id n3so5902623wiv.3 for ; Tue, 17 Jun 2014 06:53:46 -0700 (PDT) Received: from mx2.suse.de (cantor2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id gy6si24316708wjc.34.2014.06.17.06.53.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 06:53:45 -0700 (PDT) Date: Tue, 17 Jun 2014 15:53:44 +0200 From: Michal Hocko Subject: Re: [patch 04/12] mm: memcontrol: retry reclaim for oom-disabled and __GFP_NOFAIL charges Message-ID: <20140617135344.GC19886@dhcp22.suse.cz> References: <1402948472-8175-1-git-send-email-hannes@cmpxchg.org> <1402948472-8175-5-git-send-email-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1402948472-8175-5-git-send-email-hannes@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Andrew Morton , Hugh Dickins , Tejun Heo , Vladimir Davydov , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org On Mon 16-06-14 15:54:24, Johannes Weiner wrote: > There is no reason why oom-disabled and __GFP_NOFAIL charges should > try to reclaim only once when every other charge tries several times > before giving up. Make them all retry the same number of times. OK, this makes sense for oom-disabled and __GFP_NOFAIL but does it make sense to do additional reclaim for tasks with fatal_signal_pending? It is little bit unexpected, because we bypass if the condition happens before the reclaim but then we ignore it. > Signed-off-by: Johannes Weiner > --- > mm/memcontrol.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index e946f7439b16..52550bbff1ef 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -2566,7 +2566,7 @@ static int mem_cgroup_try_charge(struct mem_cgroup *memcg, > bool oom) > { > unsigned int batch = max(CHARGE_BATCH, nr_pages); > - int nr_oom_retries = MEM_CGROUP_RECLAIM_RETRIES; > + int nr_retries = MEM_CGROUP_RECLAIM_RETRIES; > struct mem_cgroup *mem_over_limit; > struct res_counter *fail_res; > unsigned long nr_reclaimed; > @@ -2638,6 +2638,9 @@ retry: > if (mem_cgroup_wait_acct_move(mem_over_limit)) > goto retry; > > + if (nr_retries--) > + goto retry; > + > if (gfp_mask & __GFP_NOFAIL) > goto bypass; > > @@ -2647,9 +2650,6 @@ retry: > if (!oom) > goto nomem; > > - if (nr_oom_retries--) > - goto retry; > - > mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(batch)); > nomem: > if (!(gfp_mask & __GFP_NOFAIL)) > -- > 2.0.0 > -- Michal Hocko SUSE Labs -- 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