All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 3/3] [PATCH 3/3] xfs: do not use xfs_mod_incore_sb_batch for per-cpu counters
Date: Wed, 29 Sep 2010 07:26:06 -0500	[thread overview]
Message-ID: <1285763166.5108.7.camel@doink> (raw)
In-Reply-To: <20100929072238.456748707@bombadil.infradead.org>

On Wed, 2010-09-29 at 03:22 -0400, Christoph Hellwig wrote:
> plain text document attachment (xfs-simplify-icsb-updates)
> Update the per-cpu counters manually in xfs_trans_unreserve_and_mod_sb and
> remove support for per-cpu counters from xfs_mod_incore_sb_batch to
> simplify it.  And added benefit is that we don't have to take m_sb_lock
> for transactions that only modify per-cpu counters.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Two undo's have the wrong sign, but if that's fixed this
looks good.

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

. . .

> Index: xfs/fs/xfs/xfs_trans.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_trans.c	2010-09-29 13:14:08.521557720 +0900
> +++ xfs/fs/xfs/xfs_trans.c	2010-09-29 13:21:58.164557721 +0900
> @@ -1017,55 +1017,61 @@ xfs_trans_unreserve_and_mod_sb(
. . .
> +
> +	/* apply the per-cpu counters */
> +	if (blkdelta) {
> +		error = xfs_icsb_modify_counters(mp, XFS_SBS_FDBLOCKS,
> +						 blkdelta, rsvd);
> +		if (error)
> +			goto out;
> +	}
> +
> +	if (idelta) {
> +		error = xfs_icsb_modify_counters(mp, XFS_SBS_ICOUNT,
> +						 idelta, rsvd);
> +		if (error)
> +			goto out_undo_fdblocks;
> +	}
> +
> +	if (ifreedelta) {
> +		error = xfs_icsb_modify_counters(mp, XFS_SBS_IFREE,
> +						 ifreedelta, rsvd);
> +		if (error)
> +			goto out_undo_icount;
> +	}
> +
> +	/* apply remaining deltas */
>  
. . .
> +	return;
> +
> +out_undo_ifreecount:
> +	if (ifreedelta)
> +		xfs_icsb_modify_counters(mp, XFS_SBS_IFREE, ifreedelta, rsvd);

*negative* ifreedelta

> +out_undo_icount:
> +	if (idelta)
> +		xfs_icsb_modify_counters(mp, XFS_SBS_ICOUNT, idelta, rsvd);

*negative* idelta

> +out_undo_fdblocks:
> +	if (blkdelta)
> +		xfs_icsb_modify_counters(mp, XFS_SBS_FDBLOCKS, -blkdelta, rsvd);
> +out:



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

  parent reply	other threads:[~2010-09-29 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29  7:22 [PATCH 0/3] clean up superblock modification helpers Christoph Hellwig
2010-09-29  7:22 ` [PATCH 1/3] [PATCH 1/3] xfs: remove XFS_MOUNT_NO_PERCPU_SB Christoph Hellwig
2010-09-29 11:29   ` Dave Chinner
2010-09-29 11:49   ` Alex Elder
2010-09-29  7:22 ` [PATCH 2/3] [PATCH 2/3] xfs: do not use xfs_mod_incore_sb for per-cpu counters Christoph Hellwig
2010-09-29 11:39   ` Dave Chinner
2010-09-29 11:45     ` Christoph Hellwig
2010-09-29 12:06   ` Alex Elder
2010-09-29  7:22 ` [PATCH 3/3] [PATCH 3/3] xfs: do not use xfs_mod_incore_sb_batch " Christoph Hellwig
2010-09-29 11:27   ` Dave Chinner
2010-09-29 11:45     ` Christoph Hellwig
2010-09-29 12:26   ` Alex Elder [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-09-30  2:25 [PATCH 0/3] streamline superblock modification helpers V2 Christoph Hellwig
2010-09-30  2:25 ` [PATCH 3/3] [PATCH 3/3] xfs: do not use xfs_mod_incore_sb_batch for per-cpu counters Christoph Hellwig
2010-10-01 13:56   ` Alex Elder

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=1285763166.5108.7.camel@doink \
    --to=aelder@sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.