Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3368915ybc; Thu, 21 Nov 2019 07:21:49 -0800 (PST) X-Google-Smtp-Source: APXvYqz4QLKCwMLA2vo4vtp0vmHtVpiksYCw9XToWgISbjJOGMD1+IbnKFRZ0oTIw4ckmmmUQvm6 X-Received: by 2002:a17:906:b6c3:: with SMTP id ec3mr14964057ejb.27.1574349709742; Thu, 21 Nov 2019 07:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574349709; cv=none; d=google.com; s=arc-20160816; b=vFAPm7MDTj7NMOssWHs4pHEcyJMAT7CSzMc2diGK3BlaLgixVAw99hzJMAXZeDS2JB 7ts5tEEV14pBLw/gT3yVXHKnOY2JD4bGLEsVwhd5Vp2V77UF28TlrJS8Aj82s6J/1qIe /NuO2itz7VAF8CGKiSz0UNA4b5OvG/G2iNBema+/iBHTIFPDtgTt4WEDHMro5PRKAaG3 EsWYUL2R9QFx69mVhfFc3fE4ayItHyugDnCC+lC3AG4rN0JiYs/dKQxFoQkmTimuZyKC Z2MNg2u+WYdfu2YvhgZTRnrbTaUySYhqIfCfIGFVBQjPRRRM/jFxrjtAUec3RvEJZHwy w0zg== 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=6OrpJ/umLD82FdlyfvGgkXFz1pMvUaPZAIZvtA0dxM4=; b=dkKyMjXe4xHKoiiWXrLj6LCZ0sYg8Qngo2ZRA+wAWko1Zph9GA9wZR04gSVLVgKvu1 VpusXIGvGjAA3Ewu56e89LB+/v7fOhDsRP+fuvwMpIklHAlyQC+0mSgBZ/jbz7YKbjsq 1cJ4XYbsnHPXBYE+3F314m6KPXlpGOCjrAY1XzLtBa9CD0ZxnhL6hICUWSIIccfLk2SE MizHURcYlEFNP9iQoIvlHu4oJB2/MYckzNk7XpQr5Y8KrmfrweOfcEdC9yur44lSQuvL eS2YsON64UKJjj/5FOkDMfHciG0gjv7Inxmulv3Ghs1G+Dv1f12s6wycFMl6JrxPrIjP YEpg== 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 mj12si2040281ejb.186.2019.11.21.07.21.24; Thu, 21 Nov 2019 07:21:49 -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 S1726968AbfKUPT7 (ORCPT + 99 others); Thu, 21 Nov 2019 10:19:59 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:60415 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbfKUPT7 (ORCPT ); Thu, 21 Nov 2019 10:19:59 -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 390EE1C000A; Thu, 21 Nov 2019 15:19:47 +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 02/19] mm, hugetlb: use for_each_node in dequeue_huge_page_nodemask() Date: Thu, 21 Nov 2019 23:17:54 +0800 Message-Id: <20191121151811.49742-3-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 dequeue_huge_page_nodemask(), we want to traverse node instead of zone, so use for_each_node instead of for_each_zone. Signed-off-by: Pengfei Li --- mm/hugetlb.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 2e55ec5dc84d..287b90c7ab36 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -850,25 +850,18 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, unsigned int cpuset_mems_cookie; struct nodelist *nodelist; struct nlist_traverser t; - struct zone *zone; - int node = NUMA_NO_NODE; + int node; nodelist = node_nodelist(nid, gfp_mask); retry_cpuset: cpuset_mems_cookie = read_mems_allowed_begin(); - for_each_zone_nlist_nodemask(zone, &t, nodelist, gfp_zone(gfp_mask), nmask) { + for_each_node_nlist_nodemask(node, &t, nodelist, + gfp_zone(gfp_mask), nmask) { struct page *page; - if (!cpuset_zone_allowed(zone, gfp_mask)) - continue; - /* - * no need to ask again on the same node. Pool is node rather than - * zone aware - */ - if (zone_to_nid(zone) == node) + if (!cpuset_node_allowed(node, gfp_mask)) continue; - node = zone_to_nid(zone); page = dequeue_huge_page_node_exact(h, node); if (page) -- 2.23.0