Commit da353b0d authored by David Chinner's avatar David Chinner Committed by Tim Shimmin
Browse files

[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: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent 39cd9f87
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -17,10 +17,12 @@
 */
#include "xfs.h"
#include "xfs_types.h"
#include "xfs_dmapi.h"
#include "xfs_inum.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_dmapi.h"
#include "xfs_mount.h"
#include "xfs_export.h"

+4 −0
Original line number Diff line number Diff line
@@ -197,6 +197,10 @@ typedef struct xfs_perag
#endif
	xfs_perag_busy_t *pagb_list;	/* unstable blocks */
	atomic_t        pagf_fstrms;    /* # of filestreams active in this AG */

	int		pag_ici_init;	/* incore inode cache initialised */
	rwlock_t	pag_ici_lock;	/* incore inode lock */
	struct radix_tree_root pag_ici_root;	/* incore inode cache root */
} xfs_perag_t;

#define	XFS_AG_MAXLEVELS(mp)		((mp)->m_ag_maxlevels)
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "xfs_inum.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_dmapi.h"
#include "xfs_mount.h"
#include "xfs_buf_item.h"
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ struct xfs_mount_args {
#define XFSMNT_IDELETE		0x08000000	/* inode cluster delete */
#define XFSMNT_SWALLOC		0x10000000	/* turn on stripe width
						 * allocation */
#define XFSMNT_IHASHSIZE	0x20000000	/* inode hash table size */
#define XFSMNT_DIRSYNC		0x40000000	/* sync creat,link,unlink,rename
						 * symlink,mkdir,rmdir,mknod */
#define XFSMNT_FLAGS2		0x80000000	/* more flags set in flags2 */
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "xfs_inum.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_dir2.h"
#include "xfs_dmapi.h"
#include "xfs_mount.h"
Loading