aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/metaslab.c
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-10-10 15:45:52 -0700
committerBrian Behlendorf <[email protected]>2019-10-10 15:45:52 -0700
commit6501906280f8f244710012116ef678007999da67 (patch)
treef615c1cba36cdcefd917972e0ab038889b17fb13 /module/zfs/metaslab.c
parenteedb3a62b9f16b989aa02d00db63de5dff200572 (diff)
Add kmem cache accessors
Make the metaslab platform agnostic again by adding accessor functions which can be implemented by each platform. Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9404
Diffstat (limited to 'module/zfs/metaslab.c')
-rw-r--r--module/zfs/metaslab.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c
index 7b8ac91b1..459f4dbbc 100644
--- a/module/zfs/metaslab.c
+++ b/module/zfs/metaslab.c
@@ -2142,8 +2142,8 @@ metaslab_potentially_evict(metaslab_class_t *mc)
{
#ifdef _KERNEL
uint64_t allmem = arc_all_memory();
- uint64_t inuse = zfs_btree_leaf_cache->skc_obj_total;
- uint64_t size = zfs_btree_leaf_cache->skc_obj_size;
+ uint64_t inuse = spl_kmem_cache_inuse(zfs_btree_leaf_cache);
+ uint64_t size = spl_kmem_cache_entry_size(zfs_btree_leaf_cache);
int tries = 0;
for (; allmem * zfs_metaslab_mem_limit / 100 < inuse * size &&
tries < multilist_get_num_sublists(mc->mc_metaslab_txg_list) * 2;
@@ -2180,7 +2180,8 @@ metaslab_potentially_evict(metaslab_class_t *mc)
*/
if (msp->ms_loading) {
msp = next_msp;
- inuse = zfs_btree_leaf_cache->skc_obj_total;
+ inuse =
+ spl_kmem_cache_inuse(zfs_btree_leaf_cache);
continue;
}
/*
@@ -2202,7 +2203,7 @@ metaslab_potentially_evict(metaslab_class_t *mc)
}
mutex_exit(&msp->ms_lock);
msp = next_msp;
- inuse = zfs_btree_leaf_cache->skc_obj_total;
+ inuse = spl_kmem_cache_inuse(zfs_btree_leaf_cache);
}
}
#endif