summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ag.h
diff options
context:
space:
mode:
authorDave Chinner <dgc@sgi.com>2009-09-01 01:58:28 +0200
committerFelix Blyakher <felixb@sgi.com>2009-09-01 19:45:48 +0200
commitbd169565993b39b9b4b102cdac8b13e0a259ce2f (patch)
tree4cc6dc56cf7a2b9af71156299e091062dbe30594 /fs/xfs/xfs_ag.h
parentxfs: rationalize xfs_inobt_lookup* (diff)
downloadlinux-bd169565993b39b9b4b102cdac8b13e0a259ce2f.tar.xz
linux-bd169565993b39b9b4b102cdac8b13e0a259ce2f.zip
xfs: speed up free inode search
Don't search too far - abort if it is outside a certain radius and simply do a linear search for the first free inode. In AGs with a million inodes this can speed up allocation speed by 3-4x. [hch: ported to the new xfs_ialloc.c world order] Signed-off-by: Dave Chinner <dgc@sgi.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Signed-off-by: Felix Blyakher <felixb@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_ag.h')
-rw-r--r--fs/xfs/xfs_ag.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h
index f24b50b68d03..a5d54bf4931b 100644
--- a/fs/xfs/xfs_ag.h
+++ b/fs/xfs/xfs_ag.h
@@ -198,6 +198,15 @@ typedef struct xfs_perag
xfs_agino_t pagi_count; /* number of allocated inodes */
int pagb_count; /* pagb slots in use */
xfs_perag_busy_t *pagb_list; /* unstable blocks */
+
+ /*
+ * Inode allocation search lookup optimisation.
+ * If the pagino matches, the search for new inodes
+ * doesn't need to search the near ones again straight away
+ */
+ xfs_agino_t pagl_pagino;
+ xfs_agino_t pagl_leftrec;
+ xfs_agino_t pagl_rightrec;
#ifdef __KERNEL__
spinlock_t pagb_lock; /* lock for pagb_list */