diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-09-23 21:21:37 +0200 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-10-19 20:45:16 +0200 |
commit | 9fa47bdcd33b117599e9ee3f2e315cb47939ac2d (patch) | |
tree | 4791e63154cebc89fb73fa4ec2218eb0cc3cd85e /fs/xfs/xfs_super.c | |
parent | xfs: compute absolute maximum nlevels for each btree type (diff) | |
download | linux-9fa47bdcd33b117599e9ee3f2e315cb47939ac2d.tar.xz linux-9fa47bdcd33b117599e9ee3f2e315cb47939ac2d.zip |
xfs: use separate btree cursor cache for each btree type
Now that we have the infrastructure to track the max possible height of
each btree type, we can create a separate slab cache for cursors of each
type of btree. For smaller indices like the free space btrees, this
means that we can pack more cursors into a slab page, improving slab
utilization.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r-- | fs/xfs/xfs_super.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 2a535a8bc3c0..6fcafc43b823 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -37,6 +37,7 @@ #include "xfs_reflink.h" #include "xfs_pwork.h" #include "xfs_ag.h" +#include "xfs_btree.h" #include <linux/magic.h> #include <linux/fs_context.h> @@ -1953,6 +1954,8 @@ MODULE_ALIAS_FS("xfs"); STATIC int __init xfs_init_zones(void) { + int error; + xfs_log_ticket_zone = kmem_cache_create("xfs_log_ticket", sizeof(struct xlog_ticket), 0, 0, NULL); @@ -1965,10 +1968,8 @@ xfs_init_zones(void) if (!xfs_bmap_free_item_zone) goto out_destroy_log_ticket_zone; - xfs_btree_cur_zone = kmem_cache_create("xfs_btree_cur", - xfs_btree_cur_sizeof(XFS_BTREE_CUR_CACHE_MAXLEVELS), - 0, 0, NULL); - if (!xfs_btree_cur_zone) + error = xfs_btree_init_cur_caches(); + if (error) goto out_destroy_bmap_free_item_zone; xfs_da_state_zone = kmem_cache_create("xfs_da_state", @@ -2106,7 +2107,7 @@ xfs_init_zones(void) out_destroy_da_state_zone: kmem_cache_destroy(xfs_da_state_zone); out_destroy_btree_cur_zone: - kmem_cache_destroy(xfs_btree_cur_zone); + xfs_btree_destroy_cur_caches(); out_destroy_bmap_free_item_zone: kmem_cache_destroy(xfs_bmap_free_item_zone); out_destroy_log_ticket_zone: @@ -2138,7 +2139,7 @@ xfs_destroy_zones(void) kmem_cache_destroy(xfs_trans_zone); kmem_cache_destroy(xfs_ifork_zone); kmem_cache_destroy(xfs_da_state_zone); - kmem_cache_destroy(xfs_btree_cur_zone); + xfs_btree_destroy_cur_caches(); kmem_cache_destroy(xfs_bmap_free_item_zone); kmem_cache_destroy(xfs_log_ticket_zone); } |