X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_00, DATE_IN_PAST_24_48,FH_DATE_PAST_20XX autolearn=no version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id o3D1IsRE178078 for ; Mon, 12 Apr 2010 20:18:54 -0500 X-ASG-Debug-ID: 1271121647-5a3d02db0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9D0181269E2B for ; Mon, 12 Apr 2010 18:20:47 -0700 (PDT) Received: from mail.internode.on.net (bld-mail13.adl6.internode.on.net [150.101.137.98]) by cuda.sgi.com with ESMTP id Z6Ntqeqm4vh1OmA6 for ; Mon, 12 Apr 2010 18:20:47 -0700 (PDT) Received: from dastard (unverified [121.44.229.111]) by mail.internode.on.net (SurgeMail 3.8f2) with ESMTP id 20483871-1927428 for multiple; Tue, 13 Apr 2010 10:50:42 +0930 (CST) Received: from dave by dastard with local (Exim 4.71) (envelope-from ) id 1O181n-0000rg-Dd; Mon, 12 Apr 2010 11:01:27 +1000 Date: Mon, 12 Apr 2010 11:01:27 +1000 From: Dave Chinner To: Chris Mason , Eric Sandeen , John Berthels , linux-kernel@vger.kernel.org, Nick Gregory , Rob Sanderson , xfs@oss.sgi.com, linux-mm@kvack.org X-ASG-Orig-Subj: Re: PROBLEM + POSS FIX: kernel stack overflow, xfs, many disks, heavy write load, 8k stack, x86-64 Subject: Re: PROBLEM + POSS FIX: kernel stack overflow, xfs, many disks, heavy write load, 8k stack, x86-64 Message-ID: <20100412010127.GD2493@dastard> References: <20100407140523.GJ11036@dastard> <4BBCAB57.3000106@humyo.com> <20100407234341.GK11036@dastard> <20100408030347.GM11036@dastard> <4BBDC92D.8060503@humyo.com> <4BBDEC9A.9070903@humyo.com> <20100408233837.GP11036@dastard> <20100409113850.GE13327@think> <4BBF6C51.5030203@sandeen.net> <20100409181108.GG13327@think> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100409181108.GG13327@think> User-Agent: Mutt/1.5.20 (2009-06-14) X-Barracuda-Connect: bld-mail13.adl6.internode.on.net[150.101.137.98] X-Barracuda-Start-Time: 1271121648 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0208 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.53 X-Barracuda-Spam-Status: No, SCORE=-1.53 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=DATE_IN_PAST_24_48, DATE_IN_PAST_24_48_2 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.27345 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.01 DATE_IN_PAST_24_48 Date: is 24 to 48 hours before Received: date 0.48 DATE_IN_PAST_24_48_2 DATE_IN_PAST_24_48_2 X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Fri, Apr 09, 2010 at 02:11:08PM -0400, Chris Mason wrote: > On Fri, Apr 09, 2010 at 01:05:05PM -0500, Eric Sandeen wrote: > > Chris Mason wrote: > > > > > shrink_zone on my box isn't 500 bytes, but lets try the easy stuff > > > first. This is against .34, if you have any trouble applying to .32, > > > just add the word noinline after the word static on the function > > > definitions. > > > > > > This makes shrink_zone disappear from my check_stack.pl output. > > > Basically I think the compiler is inlining the shrink_active_zone and > > > shrink_inactive_zone code into shrink_zone. > > > > > > -chris > > > > > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > > index 79c8098..c70593e 100644 > > > --- a/mm/vmscan.c > > > +++ b/mm/vmscan.c > > > @@ -620,7 +620,7 @@ static enum page_references page_check_references(struct page *page, > > > /* > > > * shrink_page_list() returns the number of reclaimed pages > > > */ > > > -static unsigned long shrink_page_list(struct list_head *page_list, > > > +static noinline unsigned long shrink_page_list(struct list_head *page_list, > > > > FWIW akpm suggested that I add: > > > > /* > > * Rather then using noinline to prevent stack consumption, use > > * noinline_for_stack instead. For documentaiton reasons. > > */ > > #define noinline_for_stack noinline > > > > so maybe for a formal submission that'd be good to use. > > Oh yeah, I forgot about that one. If the patch actually helps we can > switch it. Well, given that the largest stack overflow reported was about 800 bytes, I don't think it's enough. All the fat has been trimmed from XFS long ago, and there isn't that much in the generic code paths to trim. And if we consider that this isn't including a significant storage subsystem (i.e. NFS on top and stacked DM+MD+FC below), then trimming a few hundred bytes is not enough to prevent an 8k stack being blown sky high. That is why I was saying I'm not sure what the best way to solve the problem is - I've got a couple of ideas for fixing the problem in XFS once and for all, but I'm not sure if they will fly or not yet, let alone written any code.... Cheers, Dave. -- Dave Chinner david@fromorbit.com