From patchwork Thu Jan 5 08:25:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 39387 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp192667wrt; Thu, 5 Jan 2023 00:40:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXtaSNx4J3YF/UaRcjDeRgHreim571v61TRabj/FSpDq15xJvoqyU2qWdxx6C5NDZwm5e96O X-Received: by 2002:a17:90b:3597:b0:219:b1f0:ddf0 with SMTP id mm23-20020a17090b359700b00219b1f0ddf0mr54681696pjb.36.1672908037261; Thu, 05 Jan 2023 00:40:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672908037; cv=none; d=google.com; s=arc-20160816; b=via1tEnPNOoJnpkdzUllrlxDRn0j9N+5L4LRZm/xPgBZK4FV950UQaYIsI/xTR1r6e Dy5uoNPb1rURVMQTiNRTOzHOJkfuisp5AbjQ/i8Q1WNXCUO6dk4fmaJ6VNhdoNYKns1f 1CxJ6H1agxXFQM9bUTcDXuMYaoz/nrKyYk1ZflBxDlG89K6Pj8lWwmEIMUJyy/vKj1nk ZUgj7IwBQMS652xYZOGPPo+0UPcXskZnv5AcdqTbq/AKfU/Ygl3bjey1n9nFmbw/Pk2V +8sbsmXmEkfPmy0csi9jmT2rjMGnMRBjFn5+WZYLJV6JPHxzF6TUw5n+UqVgoApVhTuw UbzA== 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; bh=nkm3HTGrrjdGvrdleKy0Xx42kvAzGUKTQ5Cu4Uq5Oyo=; b=QhXtk1PpFXF0U+ZrBcTNkG7BNTwCQE5eR34LlGQfTOqQzEpctS4uT896h49CQdP6Yo sNAoH9LXi3meS1q/iiBn2TRLZwYy/wk5Y6S1zW/WhLd7Fc9mnF+dwwq/qTO3WVFtE3md RR5q7jUSHx1V4gaTEeNJEzSgM8CPx9Swz2OtMs8m/f7I38dUtFhGgJRCcU9mZNHWiLs1 0dA/eoMhFsXz/7Rt6ZG0rKZMkzLhzzL1FSRbj+nxy8mJpvCs2vOR4g4+AHoBv/ZliHPD 3k6GYNQfR/6QU5kkBCdmGtyFUdnqQofZh+tofwTOhxkfB6hLHV48pbkCClKTAkrAUkHp kOqw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ob5-20020a17090b390500b002194574db1csi1426808pjb.142.2023.01.05.00.40.24; Thu, 05 Jan 2023 00:40:37 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231742AbjAEI05 (ORCPT + 99 others); Thu, 5 Jan 2023 03:26:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231937AbjAEI0U (ORCPT ); Thu, 5 Jan 2023 03:26:20 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2BC5D4C720 for ; Thu, 5 Jan 2023 00:25:16 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 747A31063; Thu, 5 Jan 2023 00:25:57 -0800 (PST) Received: from a077893.blr.arm.com (unknown [10.162.43.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AFD873F71A; Thu, 5 Jan 2023 00:25:13 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org Cc: rppt@kernel.org, mgorman@suse.de, Anshuman Khandual , linux-kernel@vger.kernel.org Subject: [PATCH] mm/page_alloc: Repalce with deferred_pages_enabled() wherever applicable Date: Thu, 5 Jan 2023 13:55:06 +0530 Message-Id: <20230105082506.241529-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754171218132869539?= X-GMAIL-MSGID: =?utf-8?q?1754171218132869539?= Instead of directly accessing static deferred_pages, replace such instances with the helper deferred_pages_enabled(). No functional change is intended. Cc; Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Mike Rapoport (IBM) Reviewed-by: David Hildenbrand Acked-by: Mel Gorman --- This applies on v6.2-rc2. mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0745aedebb37..232d0323047b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4244,7 +4244,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, * Watermark failed for this zone, but see if we can * grow this zone if it contains deferred pages. */ - if (static_branch_unlikely(&deferred_pages)) { + if (deferred_pages_enabled()) { if (_deferred_grow_zone(zone, order)) goto try_this_zone; } @@ -4293,7 +4293,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, } else { #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT /* Try again if zone has deferred pages */ - if (static_branch_unlikely(&deferred_pages)) { + if (deferred_pages_enabled()) { if (_deferred_grow_zone(zone, order)) goto try_this_zone; }