diff options
author | David Chinner <dgc@sgi.com> | 2007-08-28 00:00:13 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 02:50:50 -0400 |
commit | da353b0d64e070ae7c5342a0d56ec20ae9ef5cfb (patch) | |
tree | 84454023d649df67cc6b125c73746ddb341ac34e /fs/xfs/xfs_mount.h | |
parent | 39cd9f877e63ce7e02cdc7f5dbf1b908451c9532 (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_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 9ceff40326d0..bc23cb407701 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -57,10 +57,7 @@ struct log; | |||
57 | struct bhv_vfs; | 57 | struct bhv_vfs; |
58 | struct bhv_vnode; | 58 | struct bhv_vnode; |
59 | struct xfs_mount_args; | 59 | struct xfs_mount_args; |
60 | struct xfs_ihash; | ||
61 | struct xfs_chash; | ||
62 | struct xfs_inode; | 60 | struct xfs_inode; |
63 | struct xfs_perag; | ||
64 | struct xfs_iocore; | 61 | struct xfs_iocore; |
65 | struct xfs_bmbt_irec; | 62 | struct xfs_bmbt_irec; |
66 | struct xfs_bmap_free; | 63 | struct xfs_bmap_free; |
@@ -335,8 +332,6 @@ typedef struct xfs_mount { | |||
335 | xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ | 332 | xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ |
336 | lock_t m_agirotor_lock;/* .. and lock protecting it */ | 333 | lock_t m_agirotor_lock;/* .. and lock protecting it */ |
337 | xfs_agnumber_t m_maxagi; /* highest inode alloc group */ | 334 | xfs_agnumber_t m_maxagi; /* highest inode alloc group */ |
338 | size_t m_ihsize; /* size of next field */ | ||
339 | struct xfs_ihash *m_ihash; /* fs private inode hash table*/ | ||
340 | struct xfs_inode *m_inodes; /* active inode list */ | 335 | struct xfs_inode *m_inodes; /* active inode list */ |
341 | struct list_head m_del_inodes; /* inodes to reclaim */ | 336 | struct list_head m_del_inodes; /* inodes to reclaim */ |
342 | mutex_t m_ilock; /* inode list mutex */ | 337 | mutex_t m_ilock; /* inode list mutex */ |
@@ -458,7 +453,7 @@ typedef struct xfs_mount { | |||
458 | #define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/ | 453 | #define XFS_MOUNT_IDELETE (1ULL << 18) /* delete empty inode clusters*/ |
459 | #define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width | 454 | #define XFS_MOUNT_SWALLOC (1ULL << 19) /* turn on stripe width |
460 | * allocation */ | 455 | * allocation */ |
461 | #define XFS_MOUNT_IHASHSIZE (1ULL << 20) /* inode hash table size */ | 456 | /* (1ULL << 20) -- currently unused */ |
462 | #define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */ | 457 | #define XFS_MOUNT_DIRSYNC (1ULL << 21) /* synchronous directory ops */ |
463 | #define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred | 458 | #define XFS_MOUNT_COMPAT_IOSIZE (1ULL << 22) /* don't report large preferred |
464 | * I/O size in stat() */ | 459 | * I/O size in stat() */ |
@@ -572,6 +567,21 @@ xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) | |||
572 | } | 567 | } |
573 | 568 | ||
574 | /* | 569 | /* |
570 | * perag get/put wrappers for eventual ref counting | ||
571 | */ | ||
572 | static inline xfs_perag_t * | ||
573 | xfs_get_perag(struct xfs_mount *mp, xfs_ino_t ino) | ||
574 | { | ||
575 | return &mp->m_perag[XFS_INO_TO_AGNO(mp, ino)]; | ||
576 | } | ||
577 | |||
578 | static inline void | ||
579 | xfs_put_perag(struct xfs_mount *mp, xfs_perag_t *pag) | ||
580 | { | ||
581 | /* nothing to see here, move along */ | ||
582 | } | ||
583 | |||
584 | /* | ||
575 | * Per-cpu superblock locking functions | 585 | * Per-cpu superblock locking functions |
576 | */ | 586 | */ |
577 | #ifdef HAVE_PERCPU_SB | 587 | #ifdef HAVE_PERCPU_SB |