Path: csiph.com!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Mel Gorman Newsgroups: linux.kernel Subject: [PATCH 05/27] mm, vmscan: Have kswapd only scan based on the highest requested zone Date: Fri, 15 Apr 2016 11:20:03 +0200 Message-ID: References: X-Original-To: Andrew Morton , Linux-MM X-Mailer: git-send-email 2.6.4 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 33 Organization: linux.* mail to news gateway X-Original-Cc: Rik van Riel , Vlastimil Babka , Johannes Weiner , Jesper Dangaard Brouer , LKML , Mel Gorman X-Original-Date: Fri, 15 Apr 2016 10:13:11 +0100 X-Original-Message-ID: <1460711613-2761-6-git-send-email-mgorman@techsingularity.net> X-Original-References: <1460711613-2761-1-git-send-email-mgorman@techsingularity.net> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1379597 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. Signed-off-by: Mel Gorman --- mm/vmscan.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 0f8dc3488f9d..f2534e8f8527 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3208,11 +3208,8 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) sc.nr_reclaimed = 0; - /* - * Scan in the highmem->dma direction for the highest - * zone which needs scanning - */ - for (i = pgdat->nr_zones - 1; i >= 0; i--) { + /* Scan from the highest requested zone to dma */ + for (i = classzone_idx; i >= 0; i--) { struct zone *zone = pgdat->node_zones + i; if (!populated_zone(zone)) -- 2.6.4