From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752746AbcBWNph (ORCPT ); Tue, 23 Feb 2016 08:45:37 -0500 Received: from outbound-smtp03.blacknight.com ([81.17.249.16]:49658 "EHLO outbound-smtp03.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752268AbcBWNpV (ORCPT ); Tue, 23 Feb 2016 08:45:21 -0500 From: Mel Gorman To: Linux-MM Cc: Rik van Riel , Vlastimil Babka , Johannes Weiner , LKML , Mel Gorman Subject: [PATCH 07/27] mm, vmscan: Have kswapd only scan based on the highest requested zone Date: Tue, 23 Feb 2016 13:44:56 +0000 Message-Id: <1456235116-32385-8-git-send-email-mgorman@techsingularity.net> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1456235116-32385-1-git-send-email-mgorman@techsingularity.net> References: <1456235116-32385-1-git-send-email-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 3e423993d374..1decaa31c4c6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3193,11 +3193,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