[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191121151811.49742-3-fly@kernel.page>
Date: Thu, 21 Nov 2019 23:17:54 +0800
From: Pengfei Li <fly@...nel.page>
To: akpm@...ux-foundation.org
Cc: mgorman@...hsingularity.net, mhocko@...nel.org, vbabka@...e.cz,
cl@...ux.com, iamjoonsoo.kim@....com, guro@...com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Pengfei Li <fly@...nel.page>
Subject: [RFC v1 02/19] mm, hugetlb: use for_each_node in dequeue_huge_page_nodemask()
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 <fly@...nel.page>
---
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
Powered by blists - more mailing lists