From patchwork Tue Mar 22 21:46:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9018DC433EF for ; Tue, 22 Mar 2022 21:46:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 252EE6B014C; Tue, 22 Mar 2022 17:46:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 202AF6B014D; Tue, 22 Mar 2022 17:46:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F0DD6B014E; Tue, 22 Mar 2022 17:46:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id F3E186B014C for ; Tue, 22 Mar 2022 17:46:05 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BA42D8249980 for ; Tue, 22 Mar 2022 21:46:05 +0000 (UTC) X-FDA: 79273355490.31.EEC153F Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf08.hostedemail.com (Postfix) with ESMTP id 423DB160026 for ; Tue, 22 Mar 2022 21:46:05 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 30886B81DBA; Tue, 22 Mar 2022 21:46:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2866C340EC; Tue, 22 Mar 2022 21:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985563; bh=L/2shDOh3xnUyMXVRhAr6pEdFIeqol9RjJVq2cMCBtQ=; h=Date:To:From:In-Reply-To:Subject:From; b=H0wzKb6jnOn1VRyAvw5n7VEQMVNrILzbRdZ5D8tTlPj4gw0y/9+JnjAuAu95gTE2Z wYqu5lwJBnCs7BCJnKaJmyS48xHflWTauGkX7h7El85is5UCy58HArWy7GxBatQ9uW 6/XSblcr7BZuoXlGitx1rzZq1YM3WsW2o2IGcJ6k= Date: Tue, 22 Mar 2022 14:46:02 -0700 To: rientjes@google.com,mhocko@suse.com,linmiaohe@huawei.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 148/227] mm/oom_kill: remove unneeded is_memcg_oom check Message-Id: <20220322214602.E2866C340EC@smtp.kernel.org> X-Rspam-User: X-Stat-Signature: jth4nhquu9f5dasmwzp4sxcphiyc17mh Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=H0wzKb6j; spf=pass (imf08.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 423DB160026 X-HE-Tag: 1647985565-742197 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: From: Miaohe Lin Subject: mm/oom_kill: remove unneeded is_memcg_oom check oom_cpuset_eligible() is always called when !is_memcg_oom(). Remove this unnecessary check. Link: https://lkml.kernel.org/r/20220224115933.20154-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: David Rientjes Acked-by: Michal Hocko Signed-off-by: Andrew Morton --- mm/oom_kill.c | 3 --- 1 file changed, 3 deletions(-) --- a/mm/oom_kill.c~mm-oom_kill-remove-unneeded-is_memcg_oom-check +++ a/mm/oom_kill.c @@ -93,9 +93,6 @@ static bool oom_cpuset_eligible(struct t bool ret = false; const nodemask_t *mask = oc->nodemask; - if (is_memcg_oom(oc)) - return true; - rcu_read_lock(); for_each_thread(start, tsk) { if (mask) {