Message ID | 20230508073538.1168-1-haifeng.xu@shopee.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1981651vqo; Mon, 8 May 2023 00:55:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OjQMJDjyCQBngWsNrUm5qT4fF7w22+ll8syG1D6iM69Dg8z4NLZjQtCARJw+Xx8QSuL79 X-Received: by 2002:a17:90a:ba91:b0:24d:f1a5:e279 with SMTP id t17-20020a17090aba9100b0024df1a5e279mr10115999pjr.12.1683532541803; Mon, 08 May 2023 00:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683532541; cv=none; d=google.com; s=arc-20160816; b=SBfyZd9jnfFzi5yEZepDToGmlMqrCHtZlEr67k+2W80GOolhXI44gyEQVWGabxo0bL SzvM6J4q/zfKUqND56xf/LhUwuV42ISiTqFLdYYk84RPIC8SfSJJsISJkflA0p1Mzu6f VltpP5UACCOxRGgSCIVk6P1cook4/cLdcmGjr6cXr7JO9YoPY8fvBy9TF2bOx0vSiDfw WnUU+doHXtsjSqtCA4+Upoa3PSGVnwP9Nb2HWA8tHTlmTZZZ0kQ3l/LbO2VJxSLkesQ7 OoKIq54kDnEPOGexB0P/XV19GFzSQGAcStcQ4LbdasDDV70Xz77z4DSSn1fGSgTLFHQS 9Z4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ygLFz5lp7rVG8bpNJQZRYXuv/EyC+2NG5vRieXJ/Ap8=; b=p5ibYYUhHDWA1BAIHFcqZnkZqXCOIAVcu5lkkdNebSWVu5e53UVdlNBQbX6LTTz/sB V8HrDdWJ/mrnn3euArRZfcTWcJXRQaVxEKrxZTbFX36e8rL/t68VcryJ5840tkTc1sM6 5iL8zqfrY2lwfbXqIPWMFruw9B2E+6B1aUOx+x1/2QvLZkybaKRCdvxH3sFZNVfRbiuW z07lg5Ryso7Ben/9A65dQN4j00DjoG0COvvdrk4zn98n441jKi2yCL5tFY0SGgWoezSU Ju3AgUau8t4I/DxJu9yHTj1TA72itgPt54HlP/YiUG3H9VifrAp9pivqMDXgrollqWnj wyQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shopee.com header.s=shopee.com header.b=FyIHeGMO; 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=REJECT sp=REJECT dis=NONE) header.from=shopee.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a17090ad08500b0024e26ee7b93si14723266pju.9.2023.05.08.00.55.27; Mon, 08 May 2023 00:55:41 -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=@shopee.com header.s=shopee.com header.b=FyIHeGMO; 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=REJECT sp=REJECT dis=NONE) header.from=shopee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233278AbjEHHgJ (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Mon, 8 May 2023 03:36:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjEHHgE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 8 May 2023 03:36:04 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8752AE79 for <linux-kernel@vger.kernel.org>; Mon, 8 May 2023 00:36:02 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6434e263962so3086235b3a.2 for <linux-kernel@vger.kernel.org>; Mon, 08 May 2023 00:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopee.com; s=shopee.com; t=1683531362; x=1686123362; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ygLFz5lp7rVG8bpNJQZRYXuv/EyC+2NG5vRieXJ/Ap8=; b=FyIHeGMOiWrw78c7PCs2FMcBOLTKivUYGJ2768dgYJR+8an+EDAR4x7uItpduIWTzU r3URbPVfohXVMN/WJm07/WX5k8IFehcJCsS7pXvIZKpfs/xQ39gsm01Jhv9tw1/V0rGX ktD8RFRlllYGE9GQgnJmJgZJpFt6ma9c+Rw/y69oL2NzbVvrjhVn3X29ZU3jRRyJFXD8 GEQ2N1WATV+Fc4Zf0wQjLqUxv9/gdWBaqOS/7+btth/HpO9viXn4jEV2HkDh9HfvJq1V WksHGDX5O1eCgJ4+ApOTiwmmwdNtVecRSVtJdHBNOuInKRn1MEYMO6lUABHYknzvpdgy nxDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683531362; x=1686123362; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ygLFz5lp7rVG8bpNJQZRYXuv/EyC+2NG5vRieXJ/Ap8=; b=CgTtgv8MZ07kwZMl8jN66QtDvUTjk8elMEXXEGqckRNUIG+lbV5LIOYuXcHD/9+OQ0 98p3KAJGeVEo245KiCrZI2aKxC7sngN9fwGcABKw5J9Cny/sShbvoSo1DVmovXcFd7fT WPacf7iv9BJtsj4f8HuwJ4vzJ0LLkkoWsh1n+IVybZ58qiRELtg0apgq1vsFw8Tmi96+ SqtfRNNC+54EEhButjz09PpokhihsK5wdR59nh+FraNwMKERWS0ypN5U4M18FaZRlqDp NqeunhCNTfKkbit+lXTOfSedNuLc8EDj5M57yHlu3rI0FsWhtUo5FiSEdeQHINHA1nW3 y5Xg== X-Gm-Message-State: AC+VfDwa6G5YU7dqCJSuzglFf3igdb0XaQNQ6tA1dd4qJMv8iKsUamsU HIIQHzT+Z/EFQBa4BjhffAAOYg== X-Received: by 2002:a05:6a20:7489:b0:f2:9378:814a with SMTP id p9-20020a056a20748900b000f29378814amr12094355pzd.49.1683531361867; Mon, 08 May 2023 00:36:01 -0700 (PDT) Received: from ubuntu-hf2.default.svc.cluster.local ([101.127.248.173]) by smtp.gmail.com with ESMTPSA id y13-20020a655b0d000000b00502ecc282e2sm5377276pgq.5.2023.05.08.00.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 00:36:01 -0700 (PDT) From: Haifeng Xu <haifeng.xu@shopee.com> To: mhocko@suse.com Cc: shakeelb@google.com, hannes@cmpxchg.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Haifeng Xu <haifeng.xu@shopee.com> Subject: [PATCH] mm, oom: do not check 0 mask in out_of_memory() Date: Mon, 8 May 2023 07:35:38 +0000 Message-Id: <20230508073538.1168-1-haifeng.xu@shopee.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765311818247824160?= X-GMAIL-MSGID: =?utf-8?q?1765311818247824160?= |
Series |
mm, oom: do not check 0 mask in out_of_memory()
|
|
Commit Message
Haifeng Xu
May 8, 2023, 7:35 a.m. UTC
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 <haifeng.xu@shopee.com>
---
mm/oom_kill.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
Comments
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 <haifeng.xu@shopee.com> Acked-by: Michal Hocko <mhocko@suse.com> 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
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; /*