From patchwork Tue Mar 22 11:56:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Wandun X-Patchwork-Id: 12788287 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 2425DC433F5 for ; Tue, 22 Mar 2022 11:37:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8036A6B0072; Tue, 22 Mar 2022 07:37:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B3986B0073; Tue, 22 Mar 2022 07:37:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A1556B0074; Tue, 22 Mar 2022 07:37:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 5D7696B0072 for ; Tue, 22 Mar 2022 07:37:33 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2C9D1217E5 for ; Tue, 22 Mar 2022 11:37:33 +0000 (UTC) X-FDA: 79271821986.04.6F9FAA1 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf21.hostedemail.com (Postfix) with ESMTP id 4D7331C001B for ; Tue, 22 Mar 2022 11:37:32 +0000 (UTC) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KN8Z50YpqzfYqb; Tue, 22 Mar 2022 19:35:57 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 22 Mar 2022 19:37:29 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 22 Mar 2022 19:37:29 +0800 From: Chen Wandun To: , , Subject: [PATCH] mm/page_alloc: simplify update of pgdat in wake_all_kswapds Date: Tue, 22 Mar 2022 19:56:35 +0800 Message-ID: <20220322115635.2708989-1-chenwandun@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Queue-Id: 4D7331C001B X-Stat-Signature: pkdj8gyodtijywshtjfpgabj6t4bh3p9 Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf21.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=chenwandun@huawei.com X-Rspamd-Server: rspam01 X-HE-Tag: 1647949052-236958 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000280, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: There is no need to update last_pgdat for each zone, only update last_pgdat when iterating the first zone of a node. Signed-off-by: Chen Wandun --- mm/page_alloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f648decfe39d..ea282630aedc 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4674,9 +4674,10 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask, for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, highest_zoneidx, ac->nodemask) { - if (last_pgdat != zone->zone_pgdat) + if (last_pgdat != zone->zone_pgdat) { wakeup_kswapd(zone, gfp_mask, order, highest_zoneidx); - last_pgdat = zone->zone_pgdat; + last_pgdat = zone->zone_pgdat; + } } }