From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752286AbcFUORL (ORCPT ); Tue, 21 Jun 2016 10:17:11 -0400 Received: from outbound-smtp02.blacknight.com ([81.17.249.8]:40471 "EHLO outbound-smtp02.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbcFUORJ (ORCPT ); Tue, 21 Jun 2016 10:17:09 -0400 From: Mel Gorman To: Andrew Morton , Linux-MM Cc: Rik van Riel , Vlastimil Babka , Johannes Weiner , LKML , Mel Gorman Subject: [PATCH 05/27] mm, vmscan: Have kswapd only scan based on the highest requested zone Date: Tue, 21 Jun 2016 15:15:44 +0100 Message-Id: <1466518566-30034-6-git-send-email-mgorman@techsingularity.net> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1466518566-30034-1-git-send-email-mgorman@techsingularity.net> References: <1466518566-30034-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 Acked-by: Vlastimil Babka --- mm/vmscan.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7d5bad437809..b5b355db97cb 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3201,11 +3201,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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f70.google.com (mail-lf0-f70.google.com [209.85.215.70]) by kanga.kvack.org (Postfix) with ESMTP id A78146B0263 for ; Tue, 21 Jun 2016 10:17:09 -0400 (EDT) Received: by mail-lf0-f70.google.com with SMTP id g18so13612519lfg.2 for ; Tue, 21 Jun 2016 07:17:09 -0700 (PDT) Received: from outbound-smtp04.blacknight.com (outbound-smtp04.blacknight.com. [81.17.249.35]) by mx.google.com with ESMTPS id x8si23911887wja.174.2016.06.21.07.17.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 21 Jun 2016 07:17:08 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp04.blacknight.com (Postfix) with ESMTPS id 23E0E98B25 for ; Tue, 21 Jun 2016 14:17:08 +0000 (UTC) From: Mel Gorman Subject: [PATCH 05/27] mm, vmscan: Have kswapd only scan based on the highest requested zone Date: Tue, 21 Jun 2016 15:15:44 +0100 Message-Id: <1466518566-30034-6-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1466518566-30034-1-git-send-email-mgorman@techsingularity.net> References: <1466518566-30034-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Linux-MM Cc: Rik van Riel , Vlastimil Babka , Johannes Weiner , LKML , Mel Gorman 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 Acked-by: Vlastimil Babka --- mm/vmscan.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7d5bad437809..b5b355db97cb 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3201,11 +3201,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 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org