aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2007-08-28 00:00:13 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 02:50:50 -0400
commitda353b0d64e070ae7c5342a0d56ec20ae9ef5cfb (patch)
tree84454023d649df67cc6b125c73746ddb341ac34e /fs/xfs/xfs_vnodeops.c
parent39cd9f877e63ce7e02cdc7f5dbf1b908451c9532 (diff)
[XFS] Radix tree based inode caching
One of the perpetual scaling problems XFS has is indexing it's incore inodes. We currently uses hashes and the default hash sizes chosen can only ever be a tradeoff between memory consumption and the maximum realistic size of the cache. As a result, anyone who has millions of inodes cached on a filesystem needs to tunes the size of the cache via the ihashsize mount option to allow decent scalability with inode cache operations. A further problem is the separate inode cluster hash, whose size is based on the ihashsize but is smaller, and so under certain conditions (sparse cluster cache population) this can become a limitation long before the inode hash is causing issues. The following patchset removes the inode hash and cluster hash and replaces them with radix trees to avoid the scalability limitations of the hashes. It also reduces the size of the inodes by 3 pointers.... SGI-PV: 969561 SGI-Modid: xfs-linux-melb:xfs-kern:29481a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index bde4a1ad90f2..15bc01b2d6a0 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -3876,7 +3876,7 @@ xfs_finish_reclaim(
3876 int locked, 3876 int locked,
3877 int sync_mode) 3877 int sync_mode)
3878{ 3878{
3879 xfs_ihash_t *ih = ip->i_hash; 3879 xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino);
3880 bhv_vnode_t *vp = XFS_ITOV_NULL(ip); 3880 bhv_vnode_t *vp = XFS_ITOV_NULL(ip);
3881 int error; 3881 int error;
3882 3882
@@ -3888,12 +3888,12 @@ xfs_finish_reclaim(
3888 * Once we have the XFS_IRECLAIM flag set it will not touch 3888 * Once we have the XFS_IRECLAIM flag set it will not touch
3889 * us. 3889 * us.
3890 */ 3890 */
3891 write_lock(&ih->ih_lock); 3891 write_lock(&pag->pag_ici_lock);
3892 spin_lock(&ip->i_flags_lock); 3892 spin_lock(&ip->i_flags_lock);
3893 if (__xfs_iflags_test(ip, XFS_IRECLAIM) || 3893 if (__xfs_iflags_test(ip, XFS_IRECLAIM) ||
3894 (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) && vp == NULL)) { 3894 (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) && vp == NULL)) {
3895 spin_unlock(&ip->i_flags_lock); 3895 spin_unlock(&ip->i_flags_lock);
3896 write_unlock(&ih->ih_lock); 3896 write_unlock(&pag->pag_ici_lock);
3897 if (locked) { 3897 if (locked) {
3898 xfs_ifunlock(ip); 3898 xfs_ifunlock(ip);
3899 xfs_iunlock(ip, XFS_ILOCK_EXCL); 3899 xfs_iunlock(ip, XFS_ILOCK_EXCL);
@@ -3902,7 +3902,8 @@ xfs_finish_reclaim(
3902 } 3902 }
3903 __xfs_iflags_set(ip, XFS_IRECLAIM); 3903 __xfs_iflags_set(ip, XFS_IRECLAIM);
3904 spin_unlock(&ip->i_flags_lock); 3904 spin_unlock(&ip->i_flags_lock);
3905 write_unlock(&ih->ih_lock); 3905 write_unlock(&pag->pag_ici_lock);
3906 xfs_put_perag(ip->i_mount, pag);
3906 3907
3907 /* 3908 /*
3908 * If the inode is still dirty, then flush it out. If the inode 3909 * If the inode is still dirty, then flush it out. If the inode