Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756338Ab3CUQ6l (ORCPT ); Thu, 21 Mar 2013 12:58:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42514 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756223Ab3CUQ6k (ORCPT ); Thu, 21 Mar 2013 12:58:40 -0400 Date: Thu, 21 Mar 2013 17:58:37 +0100 From: Michal Hocko To: Mel Gorman Cc: Linux-MM , Jiri Slaby , Valdis Kletnieks , Rik van Riel , Zlatko Calusic , Johannes Weiner , dormando , Satoru Moriya , LKML Subject: Re: [PATCH 09/10] mm: vmscan: Check if kswapd should writepage once per priority Message-ID: <20130321165600.GV6094@dhcp22.suse.cz> References: <1363525456-10448-1-git-send-email-mgorman@suse.de> <1363525456-10448-10-git-send-email-mgorman@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1363525456-10448-10-git-send-email-mgorman@suse.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1866 Lines: 61 On Sun 17-03-13 13:04:15, Mel Gorman wrote: > Currently kswapd checks if it should start writepage as it shrinks > each zone without taking into consideration if the zone is balanced or > not. This is not wrong as such but it does not make much sense either. > This patch checks once per priority if kswapd should be writing pages. Except it is not once per priority strictly speaking... It doesn't make any difference though. > Signed-off-by: Mel Gorman Reviewed-by: Michal Hocko > --- > mm/vmscan.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 84375b2..8c66e5a 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -2804,6 +2804,13 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, > } > > /* > + * If we're getting trouble reclaiming, start doing writepage > + * even in laptop mode. > + */ > + if (sc.priority < DEF_PRIORITY - 2) > + sc.may_writepage = 1; > + > + /* > * Now scan the zone in the dma->highmem direction, stopping > * at the last zone which needs scanning. > * > @@ -2876,13 +2883,6 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, > nr_to_reclaim += sc.nr_to_reclaim; > } > > - /* > - * If we're getting trouble reclaiming, start doing > - * writepage even in laptop mode. > - */ > - if (sc.priority < DEF_PRIORITY - 2) > - sc.may_writepage = 1; > - > if (zone->all_unreclaimable) { > if (end_zone && end_zone == i) > end_zone--; > -- > 1.8.1.4 > -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/