[RFC v1 10/19] mm, page_alloc: use for_each_node in wake_all_kswapds()

From: Pengfei Li
Date: Thu Nov 21 2019 - 10:21:18 EST


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 <fly@xxxxxxxxxxx>
---
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