[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191121151811.49742-7-fly@kernel.page>
Date: Thu, 21 Nov 2019 23:17:58 +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 06/19] mm, vmscan: use for_each_node in do_try_to_free_pages()
In do_try_to_free_pages(), 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/vmscan.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index a3ad433c8ff4..159a2aaa8db1 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3033,9 +3033,9 @@ static unsigned long do_try_to_free_pages(struct nodelist *nodelist,
struct scan_control *sc)
{
int initial_priority = sc->priority;
- pg_data_t *last_pgdat;
+ pg_data_t *pgdat;
struct nlist_traverser t;
- struct zone *zone;
+ int node;
retry:
delayacct_freepages_start();
@@ -3062,20 +3062,17 @@ static unsigned long do_try_to_free_pages(struct nodelist *nodelist,
sc->may_writepage = 1;
} while (--sc->priority >= 0);
- last_pgdat = NULL;
- for_each_zone_nlist_nodemask(zone, &t, nodelist, sc->reclaim_idx,
- sc->nodemask) {
- if (zone->zone_pgdat == last_pgdat)
- continue;
- last_pgdat = zone->zone_pgdat;
+ for_each_node_nlist_nodemask(node, &t, nodelist,
+ sc->reclaim_idx, sc->nodemask) {
+ pgdat = NODE_DATA(node);
- snapshot_refaults(sc->target_mem_cgroup, zone->zone_pgdat);
+ snapshot_refaults(sc->target_mem_cgroup, pgdat);
if (cgroup_reclaim(sc)) {
struct lruvec *lruvec;
lruvec = mem_cgroup_lruvec(sc->target_mem_cgroup,
- zone->zone_pgdat);
+ pgdat);
clear_bit(LRUVEC_CONGESTED, &lruvec->flags);
}
}
--
2.23.0
Powered by blists - more mailing lists