xfs
[Top] [All Lists]

Re: [PATCH] xfs: reduce stack usage in xfs_bmap_btalloc()

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] xfs: reduce stack usage in xfs_bmap_btalloc()
From: Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>
Date: Sun, 27 Apr 2008 01:05:17 +0200
Cc: David Chinner <dgc@xxxxxxx>, xfs@xxxxxxxxxxx, Adrian Bunk <bunk@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; bh=TRf5R94JPl/sbzeTIa9p10LpOEsxmqYI28yKPTlehZ4=; b=FiVQffh0x36XQp1QH0X++Xw20XgZyxQfz/iuwfrcCrGJDb5xQCBj2TYckFRvmLBY1BKfh4hpVQ+w/nxotXpPQ4eCXWS9KolT+oWKXUQzqQSZWR3JtrUhdwMWh1LJgdxlS9yOIMFIa3/m+tlu2uP0voKiHKqTzgConRf8emTys6c=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=Z8t9MZMPrEbdJbtYK0liU7u4StDOj/iRqU4qw/yrMkjfisqZBLTs/WSPYSCdlrVbS1RUEk5urRdZ6cQf7tDgiSG9u09eQviRgPZH7ukUXys4pFkYbyX11H5rricg38V9scsbM7XcGEuAtCpdA0dqFE5uLiAzD8N5luqjbuiJn/E=
In-reply-to: <48137A7E.4000202@xxxxxxxxxxx>
References: <200804261651.02078.vda.linux@xxxxxxxxxxxxxx> <48137A7E.4000202@xxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: KMail/1.8.2
On Saturday 26 April 2008 20:54, Eric Sandeen wrote:
> > This patch reduces xfs_bmap_btalloc() stack usage by 50 bytes
> > by moving part of its body into a helper function.
> > 
> > This results in some variables not taking stack space in
> > xfs_bmap_btalloc() anymore.
> > 
> > The helper itself does not call anything stack-deep.
> > Stack-deep call to xfs_alloc_vextent() happen
> > in xfs_bmap_btalloc(), as before.
> > 
> > Compile tested only.
> > 
> > Signed-off-by: Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>
> 
> Looks like a very good approach, it pushes a lot of large local vars off
> into the helper.
> 
> There is one build-time problem if DEBUG is turned on:
> 
>         if (args.fsbno != NULLFSBLOCK) {
>                 ap->firstblock = ap->rval = args.fsbno;
>                 ASSERT(nullfb || fb_agno == args.agno ||
>                        (ap->low && fb_agno < args.agno));
> 
> in xfs_bmap_btalloc, which no longer has an fb_agno variable which the
> ASSERT macro uses.

Do you want me to rework and resend the patch?
--
vda


<Prev in Thread] Current Thread [Next in Thread>