mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <pcd@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #9404
This commit is contained in:
committed by
Brian Behlendorf
parent
eedb3a62b9
commit
6501906280
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user