Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3373712ybc; Thu, 21 Nov 2019 07:25:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzAquEtDzEk+rbdAb200epSN2o5DKmct2zMnPfbjdRv6/hUtGkAr/b83SDM9blU+2Jsb4rW X-Received: by 2002:ac2:508f:: with SMTP id f15mr8047313lfm.146.1574349935213; Thu, 21 Nov 2019 07:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574349935; cv=none; d=google.com; s=arc-20160816; b=G+Kb71Kc9hs+slO16XEBbjhO9YHmTig52MMVO8g2WN+g1jrYGRfHt1RfTcyUDS75L+ bDGusL0Ar+jk8DA5V5C4kOw7HhdpSVc8bpw4rXGy82HMcq3/0pFQMF27woayC5w5J11j 2ldo+EB6uF50B3gDQNozSCFyN7VcYErjjgye9hVs8k6tIiaRgqdmEA19UdReRjvPu13l XqkQDq03ZexXQWiCjPIK3SP8wGkvmmPXEArBVi6miB3BKphKAgG4dVBBq5bqnXvJFyc8 me9DXWSAL+P2OeDOyWktKZgSxgBbbsVt3QAusVxjobw1aD/T0is4aCT/nW31UOr4vSx+ rkRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rlm7TnMaUWdIFItSBpa7PwfOpfjzqLEabgB8maVmXWw=; b=KN2HEWv5x0p+1jaSTBY25DZzbtpaWZvG4v45HRWjWOsRgzM34q2X/Uvrt5ZFD6FGZ6 CCYmSsk6rIvbx5LfeW9SEnTCH1CRpSo4254ipu821okcyVxNupLHuREBlgRx4TL+9A9m tGZfxrPWCn7PBlEtaUJ+gtz/Ute9PKTRZgixKr/BIJRizmCecPjIusgWlG3oYXotdsga HxjP7dgPJG7XXQV8fkF/F/sG34jiTEhVdQeowsoV6YQd6xXRY1tS54AWDMjlwjBHBc6L c42J1Tz/qxfqo6l3fSQ2cqO//5XKcF9f30+dzChqRHz0y5TH4VXN/J5tlpzPZFwBOqdR t50A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si2412164edm.299.2019.11.21.07.25.06; Thu, 21 Nov 2019 07:25:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbfKUPVQ (ORCPT + 99 others); Thu, 21 Nov 2019 10:21:16 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:40119 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbfKUPVQ (ORCPT ); Thu, 21 Nov 2019 10:21:16 -0500 X-Originating-IP: 153.3.140.100 Received: from localhost.localdomain.localdomain (unknown [153.3.140.100]) (Authenticated sender: fly@kernel.page) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id A3E1E1C000F; Thu, 21 Nov 2019 15:21:05 +0000 (UTC) From: Pengfei Li To: akpm@linux-foundation.org Cc: mgorman@techsingularity.net, mhocko@kernel.org, vbabka@suse.cz, cl@linux.com, iamjoonsoo.kim@lge.com, guro@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pengfei Li Subject: [RFC v1 10/19] mm, page_alloc: use for_each_node in wake_all_kswapds() Date: Thu, 21 Nov 2019 23:18:02 +0800 Message-Id: <20191121151811.49742-11-fly@kernel.page> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191121151811.49742-1-fly@kernel.page> References: <20191121151811.49742-1-fly@kernel.page> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In wake_all_kswapds(), we want to traverse node instead of zone, so use for_each_node instead of for_each_zone. Signed-off-by: Pengfei Li --- mm/page_alloc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2dcf2a21c578..aa5c2ef4f8ec 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4166,15 +4166,12 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask, const struct alloc_context *ac) { enum zone_type high_zoneidx = ac->high_zoneidx; - pg_data_t *last_pgdat = NULL; struct nlist_traverser t; - struct zone *zone; + int node; - for_each_zone_nlist_nodemask(zone, &t, ac->nodelist, high_zoneidx, - ac->nodemask) { - if (last_pgdat != zone->zone_pgdat) - wakeup_kswapd(zone->zone_pgdat, gfp_mask, order, high_zoneidx); - last_pgdat = zone->zone_pgdat; + for_each_node_nlist_nodemask(node, &t, ac->nodelist, + high_zoneidx, ac->nodemask) { + wakeup_kswapd(NODE_DATA(node), gfp_mask, order, high_zoneidx); } } -- 2.23.0