From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) by kanga.kvack.org (Postfix) with SMTP id E6D086B0200 for ; Fri, 16 Apr 2010 00:23:41 -0400 (EDT) Date: Fri, 16 Apr 2010 14:23:08 +1000 From: Dave Chinner Subject: Re: [PATCH 06/10] vmscan: Split shrink_zone to reduce stack usage Message-ID: <20100416042308.GZ2493@dastard> References: <1271352103-2280-1-git-send-email-mel@csn.ul.ie> <1271352103-2280-7-git-send-email-mel@csn.ul.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1271352103-2280-7-git-send-email-mel@csn.ul.ie> Sender: owner-linux-mm@kvack.org To: Mel Gorman Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Mason , KOSAKI Motohiro , Andi Kleen , Johannes Weiner List-ID: On Thu, Apr 15, 2010 at 06:21:39PM +0100, Mel Gorman wrote: > shrink_zone() calculculates how many pages it needs to shrink from each > LRU list in a given pass. It uses a number of temporary variables to > work this out that then remain on the stack. This patch splits the > function so that some of the stack variables can be discarded. > > Signed-off-by: Mel Gorman > --- > mm/vmscan.c | 29 +++++++++++++++++++---------- > 1 files changed, 19 insertions(+), 10 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 1ace7c6..a374879 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1595,19 +1595,14 @@ static unsigned long nr_scan_try_batch(unsigned long nr_to_scan, > return nr; > } > > -/* > - * This is a basic per-zone page freer. Used by both kswapd and direct reclaim. > - */ > -static void shrink_zone(struct zone *zone, struct scan_control *sc) > +/* Calculate how many pages from each LRU list should be scanned */ > +static void calc_scan_trybatch(struct zone *zone, > + struct scan_control *sc, unsigned long *nr) Needs "noinline_for_stack" to stop the compiler re-inlining it. Cheers, Dave. -- Dave Chinner david@fromorbit.com -- 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