public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Dave Chinner <dchinner@redhat.com>, xfs@oss.sgi.com
Subject: Re: [PATCH 23/27] rearrange bmapi and bmalloca structures for best packing
Date: Mon, 19 Sep 2011 10:52:27 -0500	[thread overview]
Message-ID: <1316447547.2941.7.camel@doink> (raw)
In-Reply-To: <20110918204147.015140236@bombadil.infradead.org>

On Sun, 2011-09-18 at 16:41 -0400, Christoph Hellwig wrote:
> plain text document attachment (xfs-bmalloca-shrink)
> Minimise the stack overhead of the remaining stack variables and
> structures placed on the stack by packing them without holes. pahole
> is used to optimise allocation args structures, stack variables are
> done manually.
> 
> [hch: various updates while forward porting the changes]
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

I don't object to it, but I do comment on something
below that I think is not an improvement.  I'll
take this as-is anyway, unless you care to re-submit
it.

Reviewed-by: Alex Elder <aelder@sgi.com>

. . .

> Index: xfs/fs/xfs/xfs_bmap.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_bmap.c	2011-09-11 08:47:11.743121736 -0400
> +++ xfs/fs/xfs/xfs_bmap.c	2011-09-11 09:05:37.706448434 -0400

. . .

> @@ -4899,19 +4886,21 @@ xfs_bmapi_write(
>  	bma.userdata = 0;
>  	bma.flist = flist;
>  	bma.firstblock = firstblock;
> +	bma.eof = n;
> +	bma.conv = !!(flags & XFS_BMAPI_CONVERT);
>  
> +	n = 0;
> +	end = bno + len;
> +	obno = bno;
>  	while (bno < end && n < *nmap) {
> -		inhole = eof || bma.got.br_startoff > bno;
> -		wasdelay = !inhole && isnullstartblock(bma.got.br_startblock);
> -
>  		/*
> -		 * First, deal with the hole before the allocated space
> -		 * that we found, if any.
> +		 * If we are past EOF, in a hole in a delayed allocation call
> +		 * the allocator to get us a real allocation first.
>  		 */
> -		if (inhole || wasdelay) {
> -			bma.eof = eof;
> -			bma.conv = !!(flags & XFS_BMAPI_CONVERT);
> -			bma.wasdel = wasdelay;
> +		if (bma.eof || bma.got.br_startoff > bno ||
> +		    isnullstartblock(bma.got.br_startblock)) {
> +			bma.wasdel = isnullstartblock(bma.got.br_startblock) &&
> +					!bma.eof && bma.got.br_startoff <= bno;

I think this detracts from readability and simplicity
rather than adding to it.  I understand the desire to
get rid of the local variables, and I do follow what
each piece of this conditional means, but "inhole"
and "wasdelay" were actually quite nice shorthands
for what that logic represents.

>  			bma.length = len;
>  			bma.offset = bno;
>  

. . .

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-09-19 15:52 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-18 20:40 [PATCH 00/27] xfs_bmapi split and cleanups V2 Christoph Hellwig
2011-09-18 20:40 ` [PATCH 01/27] xfs: remove the first extent special case in xfs_bmap_add_extent Christoph Hellwig
2011-09-18 20:40 ` [PATCH 02/27] xfs: remove impossible to read code in xfs_bmap_add_extent_delay_real Christoph Hellwig
2011-09-18 20:40 ` [PATCH 03/27] xfs: remove the nextents variable in xfs_bmapi Christoph Hellwig
2011-09-18 20:40 ` [PATCH 04/27] xfs: factor extent map manipulations out of xfs_bmapi Christoph Hellwig
2011-09-18 20:40 ` [PATCH 05/27] xfs: introduce xfs_bmapi_read() Christoph Hellwig
2011-09-18 20:40 ` [PATCH 06/27] xfs: remove xfs_bmapi_single() Christoph Hellwig
2011-09-18 20:40 ` [PATCH 07/27] xfs: factor delalloc reservations out of xfs_bmapi Christoph Hellwig
2011-09-18 20:40 ` [PATCH 08/27] xfs: introduce xfs_bmapi_delay() Christoph Hellwig
2011-09-18 20:40 ` [PATCH 09/27] xfs: do not use xfs_bmap_add_extent for adding delalloc extents Christoph Hellwig
2011-09-18 20:40 ` [PATCH 10/27] xfs: factor extent allocation out of xfs_bmapi Christoph Hellwig
2011-09-18 20:40 ` [PATCH 11/27] xfs: factor unwritten extent map manipulations " Christoph Hellwig
2011-09-18 20:40 ` [PATCH 12/27] xfs: rename xfs_bmapi to xfs_bmapi_write Christoph Hellwig
2011-09-18 20:40 ` [PATCH 13/27] xfs: introduce xfs_bmap_last_extent Christoph Hellwig
2011-09-18 20:40 ` [PATCH 14/27] xfs: remove xfs_bmap_add_extent Christoph Hellwig
2011-09-18 20:40 ` [PATCH 15/27] xfs: pass bmalloca structure to xfs_bmap_isaeof Christoph Hellwig
2011-09-18 20:40 ` [PATCH 16/27] xfs: move extent records into bmalloca structure Christoph Hellwig
2011-09-18 20:40 ` [PATCH 17/27] xfs: move firstblock and bmap freelist cursor " Christoph Hellwig
2011-09-18 20:40 ` [PATCH 18/27] xfs: rename allocation range fields in struct xfs_bmalloca Christoph Hellwig
2011-09-18 20:40 ` [PATCH 19/27] xfs: do not keep local copies of allocation ranges in xfs_bmapi_allocate Christoph Hellwig
2011-09-18 20:41 ` [PATCH 20/27] xfs: move btree cursor into bmalloca Christoph Hellwig
2011-09-18 20:41 ` [PATCH 21/27] xfs: move lastx and nallocs " Christoph Hellwig
2011-09-18 20:41 ` [PATCH 22/27] xfs: move logflags " Christoph Hellwig
2011-09-18 20:41 ` [PATCH 23/27] rearrange bmapi and bmalloca structures for best packing Christoph Hellwig
2011-09-19 15:52   ` Alex Elder [this message]
2011-09-21 14:06     ` Christoph Hellwig
2011-09-21 19:05       ` Alex Elder
2011-09-18 20:41 ` [PATCH 24/27] xfs: pass bmalloca to xfs_bmap_add_extent_delay_real Christoph Hellwig
2011-09-18 20:41 ` [PATCH 25/27] xfs: pass bmalloca to xfs_bmap_add_extent_hole_real Christoph Hellwig
2011-09-18 20:41 ` [PATCH 26/27] xfs: dont ignore error code from xfs_bmbt_update Christoph Hellwig
2011-09-18 20:41 ` [PATCH 27/27] xfs: cleanup xfs_bmap.h Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316447547.2941.7.camel@doink \
    --to=aelder@sgi.com \
    --cc=dchinner@redhat.com \
    --cc=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox