From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B3CDC433E0 for ; Wed, 24 Feb 2021 09:14:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E7ED964E2B for ; Wed, 24 Feb 2021 09:14:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7ED964E2B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 28D786B0006; Wed, 24 Feb 2021 04:14:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 215E56B006C; Wed, 24 Feb 2021 04:14:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B72E6B006E; Wed, 24 Feb 2021 04:14:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id E3CCC6B0006 for ; Wed, 24 Feb 2021 04:14:33 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AA87D8248D52 for ; Wed, 24 Feb 2021 09:14:33 +0000 (UTC) X-FDA: 77852600826.12.9E865CD Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf30.hostedemail.com (Postfix) with ESMTP id 1418FE0011D9 for ; Wed, 24 Feb 2021 09:14:32 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1614158072; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FeA/2l27nVF/DGAxR2L37LYDHmL612+GcS6A2XoF94U=; b=aaBZQMHz3G2QqX4ncvXcTnQO6jkI1yH4iqWbcFQWhBD7EViANhw9jiT2vp3seI1HsyFSHz ZGrnILaRTgItVS3oEERlci6psg1StBolgA/TJ9EfmWhvjHMFwKMRGLT9uASLTYL9THTzg8 2dQ0FGLeQuWebMaa7i6C5FzcFk63OKs= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D3323AE47; Wed, 24 Feb 2021 09:14:31 +0000 (UTC) Date: Wed, 24 Feb 2021 10:14:31 +0100 From: Michal Hocko To: Shakeel Butt Cc: David Rientjes , Johannes Weiner , Roman Gushchin , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memcg: enable memcg oom-kill for __GFP_NOFAIL Message-ID: References: <20210223204337.2785120-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210223204337.2785120-1-shakeelb@google.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1418FE0011D9 X-Stat-Signature: gwtoawh5iubqpkhcy5zf8mjjqse7x44n Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf30; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614158072-986080 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 23-02-21 12:43:37, Shakeel Butt wrote: > In the era of async memcg oom-killer, the commit a0d8b00a3381 ("mm: > memcg: do not declare OOM from __GFP_NOFAIL allocations") added the code > to skip memcg oom-killer for __GFP_NOFAIL allocations. The reason was > that the __GFP_NOFAIL callers will not enter aync oom synchronization > path and will keep the task marked as in memcg oom. At that time the > tasks marked in memcg oom can bypass the memcg limits and the oom > synchronization would have happened later in the later userspace > triggered page fault. Thus letting the task marked as under memcg oom > bypass the memcg limit for arbitrary time. > > With the synchronous memcg oom-killer (commit 29ef680ae7c21 ("memcg, > oom: move out_of_memory back to the charge path")) and not letting the > task marked under memcg oom to bypass the memcg limits (commit > 1f14c1ac19aa4 ("mm: memcg: do not allow task about to OOM kill to bypass > the limit")), we can again allow __GFP_NOFAIL allocations to trigger > memcg oom-kill. This will make memcg oom behavior closer to page > allocator oom behavior. The patch is correct, I just do follow why 1f14c1ac19aa4 is really relevant here. There nomem label wouldn't make any difference for __GFP_NOFAIL requests. The code has has changed quite a lot since then. > Signed-off-by: Shakeel Butt This is a clear overlook when I moved the oom handling back to the charge path. Thanks for the fixup. Acked-by: Michal Hocko > --- > mm/memcontrol.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 2db2aeac8a9e..dcb5665aeb69 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -2797,9 +2797,6 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, > if (gfp_mask & __GFP_RETRY_MAYFAIL) > goto nomem; > > - if (gfp_mask & __GFP_NOFAIL) > - goto force; > - > if (fatal_signal_pending(current)) > goto force; > > -- > 2.30.0.617.g56c4b15f3c-goog -- Michal Hocko SUSE Labs