xfs
[Top] [All Lists]

Re: [PATCH 3/3] [PATCH 3/3] xfs: do not use xfs_mod_incore_sb_batch for

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 3/3] [PATCH 3/3] xfs: do not use xfs_mod_incore_sb_batch for per-cpu counters
From: Alex Elder <aelder@xxxxxxx>
Date: Wed, 29 Sep 2010 07:26:06 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20100929072238.456748707@xxxxxxxxxxxxxxxxxxxxxx>
References: <20100929072221.583672974@xxxxxxxxxxxxxxxxxxxxxx> <20100929072238.456748707@xxxxxxxxxxxxxxxxxxxxxx>
Reply-to: aelder@xxxxxxx
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@xxxxxx>

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

Reviewed-by: Alex Elder <aelder@xxxxxxx> 

. . .

> 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:



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