xfs
[Top] [All Lists]

Re: [PATCH] optimize XFS_IS_REALTIME_INODE w/o realtime config

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] optimize XFS_IS_REALTIME_INODE w/o realtime config
From: David Chinner <dgc@xxxxxxx>
Date: Sat, 25 Aug 2007 00:08:23 +1000
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <46C7627A.60503@sandeen.net>
References: <46C7627A.60503@sandeen.net>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
On Sat, Aug 18, 2007 at 04:19:54PM -0500, Eric Sandeen wrote:
> Use XFS_IS_REALTIME_INODE in more places, and #define it to
> 0 if CONFIG_XFS_RT is off.  This should be safe because mount
> checks in xfs_rtmount_init:
> 
> # define xfs_rtmount_init(m)    (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))
> 
> so if we get mounted w/o CONFIG_XFS_RT, no realtime inodes should
> be encountered after that.
> 
> Defining XFS_IS_REALTIME_INODE to 0 saves a bit of stack space,
> presumeably gcc can optimize around the various "if (0)" type
> checks:
> 
> xfs_alloc_file_space  -8
> xfs_bmap_adjacent     -16
> xfs_bmapi             -8
> xfs_bmap_rtalloc      -16
> xfs_bunmapi           -28
> xfs_free_file_space   -64
> xfs_imap              +8  <-- ?  hmm.
> xfs_iomap_write_direct        -12
> xfs_qm_dqusage_adjust -4
> xfs_qm_vop_chown_reserve -4
> 
> Compile tested only at this point.

This misses a bunch of tests (at least in the current tot)
in xfs_bmap.c, xfs_bmap_btree.c, xfs_iget.c, dmapi/xfs_dm.c and
linux-2.6/xfs_lrw.c. I think they are all in assert statements,
but shoul dbe cleaned up as well.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group


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