Skip to content

Commit f7b6092

Browse files
gormanmtorvalds
authored andcommitted
mm, vmscan: have kswapd only scan based on the highest requested zone
kswapd checks all eligible zones to see if they need balancing even if it was woken for a lower zone. This made sense when we reclaimed on a per-zone basis because we wanted to shrink zones fairly so avoid age-inversion problems. Ideally this is completely unnecessary when reclaiming on a per-node basis. In theory, there may still be anomalies when all requests are for lower zones and very old pages are preserved in higher zones but this should be the exceptional case. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mel Gorman <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Hillf Danton <[email protected]> Acked-by: Johannes Weiner <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b2e1875 commit f7b6092

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

mm/vmscan.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,11 +3209,8 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
32093209

32103210
sc.nr_reclaimed = 0;
32113211

3212-
/*
3213-
* Scan in the highmem->dma direction for the highest
3214-
* zone which needs scanning
3215-
*/
3216-
for (i = pgdat->nr_zones - 1; i >= 0; i--) {
3212+
/* Scan from the highest requested zone to dma */
3213+
for (i = classzone_idx; i >= 0; i--) {
32173214
struct zone *zone = pgdat->node_zones + i;
32183215

32193216
if (!populated_zone(zone))

0 commit comments

Comments
 (0)