lkml.org 
[lkml]   [2008]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] xfs: reduce stack usage in xfs_bmap_btalloc()
Denys Vlasenko wrote:
> Hi David,
>
> 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@googlemail.com>
> --
> vda
>

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.

Thanks,

-Eric


\
 
 \ /
  Last update: 2008-04-26 20:57    [from the cache]
©2003-2011 Jasper Spaans