Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4428617rwr; Mon, 8 May 2023 07:34:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4SwjrfxBWol6rQvaX5heokcnslT3WQIWQB9ttoDcBHxxxqh8wL/JfG8ji7iKUQprFH3/+N X-Received: by 2002:a17:90b:3e8c:b0:24e:55a8:bdb with SMTP id rj12-20020a17090b3e8c00b0024e55a80bdbmr11005747pjb.39.1683556462764; Mon, 08 May 2023 07:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683556462; cv=none; d=google.com; s=arc-20160816; b=FyzlsNGFoT2qD19bZAPyMPGT9uww5vwCD1IV8fWPc9UNXoQqdbyAKjByDFmBbVA1cn AMlY1GB6bw0vp3WV10MNau0lwgNi4c9AidTye05pLhutZN5SpR6y+AG6zIJrHxylSDxU 8vDzstn1nMMHjqgW5kJOuf6xGGQYfcTjnq28X0jbD0iNJHuQ/aItaby1OPQHmnIsSMQQ lqOc/nQus9Q1djSX+KltdHnbftlvL7TI2vaQ1dCvoFLU96dCSUVTfnun/bSVEAZty9s6 W/Qbxw25HJMc73jBgKiu5+ELsX8qa9l5pUVOD+2HiFaPvfXQFC+NFzqAM/iPobX7/Avt jr0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1+CnzOGbtXpZAgNtp1Sbc0yNA//AQM0s+VQt27TC/ik=; b=kofuovy8K4KNxVxe/WS51wg0q82asj2etT6JeuuUJ+8rkHHvhUZzsqM9Ik5BjADyoz Qa1pT2y8TZ0bLz3ItDHfMkHIkriso+/+IfPIt4npyOoZpfe7Y4DPMdRI6PrsO7nmwbzL 5nT7ETxNLcPAFKfW/kc5To4vbXrneUU76azNOFRJL2xCYT6xAnbQ2aIs2u579RtTHdvm XOEXAkuWrNQNoqB9scWnFi2akHhLuIrEGba06X1gnP79WieWGDG7mnnnjSpXC7KUd+VF vJdCL6uGauyQxaCZCccZ3j+RymmaVo9C5O/vLgcYABFmY2iri4yjd/iVu/5XPOhq/QWT R1oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="eVM/8o1a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a63dc01000000b00528e0b1dd0asi9163938pgg.735.2023.05.08.07.34.07; Mon, 08 May 2023 07:34:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="eVM/8o1a"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234442AbjEHOW2 (ORCPT + 99 others); Mon, 8 May 2023 10:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231641AbjEHOW1 (ORCPT ); Mon, 8 May 2023 10:22:27 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77C5119B9 for ; Mon, 8 May 2023 07:22:25 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0FC931FF4C; Mon, 8 May 2023 14:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1683555744; 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=1+CnzOGbtXpZAgNtp1Sbc0yNA//AQM0s+VQt27TC/ik=; b=eVM/8o1alDoqtQpkgMPhmAod2H5Fc6iyKsQDNKeqMLlHo/xPCR35JDYD+d+I7w4UZ9kWH3 VCrzjKQvEPzPDVRetbxkswIOt8zxpkW/T4CbCF8/1fcRlTaJQbpnBLhdaXRKFVAV5Eaatf xxnm38qzJa8/0EbQEiMAH7BZSOHR0A4= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7FAFE1346B; Mon, 8 May 2023 14:22:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jLHpEJ8FWWQJCgAAMHmgww (envelope-from ); Mon, 08 May 2023 14:22:23 +0000 Date: Mon, 8 May 2023 16:22:21 +0200 From: Michal Hocko To: Haifeng Xu Cc: shakeelb@google.com, hannes@cmpxchg.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm, oom: do not check 0 mask in out_of_memory() Message-ID: References: <20230508073538.1168-1-haifeng.xu@shopee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230508073538.1168-1-haifeng.xu@shopee.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 08-05-23 07:35:38, Haifeng Xu wrote: > Since commit 60e2793d440a ("mm, oom: do not trigger out_of_memory > from the #PF"), no user sets gfp_mask to 0. Remove the 0 mask check > and update the comments. > > Signed-off-by: Haifeng Xu Acked-by: Michal Hocko Thanks! > --- > mm/oom_kill.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 044e1eed720e..612b5597d3af 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -1130,12 +1130,10 @@ bool out_of_memory(struct oom_control *oc) > > /* > * The OOM killer does not compensate for IO-less reclaim. > - * pagefault_out_of_memory lost its gfp context so we have to > - * make sure exclude 0 mask - all other users should have at least > - * ___GFP_DIRECT_RECLAIM to get here. But mem_cgroup_oom() has to > - * invoke the OOM killer even if it is a GFP_NOFS allocation. > + * But mem_cgroup_oom() has to invoke the OOM killer even > + * if it is a GFP_NOFS allocation. > */ > - if (oc->gfp_mask && !(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc)) > + if (!(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc)) > return true; > > /* > -- > 2.25.1 -- Michal Hocko SUSE Labs