From 669dedb33f4bf68ba75089f1e7b279932c9580a7 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Wed, 24 Jun 2015 15:48:22 -0700 Subject: [PATCH] Illumos 5163 - arc should reap range_seg_cache 5163 arc should reap range_seg_cache Reviewed by: Christopher Siden Reviewed by: Matthew Ahrens Reviewed by: Richard Elling Reviewed by: Saso Kiselkov Approved by: Dan McDonald References: https://www.illumos.org/issues/5163 https://github.com/illumos/illumos-gate/commit/83803b5 Porting Notes: Added umem_cache_reap_now() wrapped to suppress unused variable warning for user space build in arc_kmem_reap_now(). Ported-by: Brian Behlendorf --- include/sys/zfs_context.h | 2 +- lib/libspl/include/umem.h | 5 +++++ module/zfs/arc.c | 2 ++ module/zfs/range_tree.c | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 62f7611fa3..acd370b234 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -408,7 +408,7 @@ extern void kstat_set_raw_ops(kstat_t *ksp, #define kmem_cache_alloc(_c, _f) umem_cache_alloc(_c, _f) #define kmem_cache_free(_c, _b) umem_cache_free(_c, _b) #define kmem_debugging() 0 -#define kmem_cache_reap_now(_c) /* nothing */ +#define kmem_cache_reap_now(_c) umem_cache_reap_now(_c); #define kmem_cache_set_move(_c, _cb) /* nothing */ #define POINTER_INVALIDATE(_pp) /* nothing */ #define POINTER_IS_VALID(_p) 0 diff --git a/lib/libspl/include/umem.h b/lib/libspl/include/umem.h index b1c9cb7ff3..a89cb4950d 100644 --- a/lib/libspl/include/umem.h +++ b/lib/libspl/include/umem.h @@ -191,6 +191,11 @@ umem_cache_free(umem_cache_t *cp, void *ptr) umem_free(ptr, cp->cache_bufsize); } +static inline void +umem_cache_reap_now(umem_cache_t *cp) +{ +} + #ifdef __cplusplus } #endif diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 99fa698722..9bf5272037 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -3043,6 +3043,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t strat, uint64_t bytes) kmem_cache_t *prev_data_cache = NULL; extern kmem_cache_t *zio_buf_cache[]; extern kmem_cache_t *zio_data_buf_cache[]; + extern kmem_cache_t *range_seg_cache; if ((arc_meta_used >= arc_meta_limit) && zfs_arc_meta_prune) { /* @@ -3073,6 +3074,7 @@ arc_kmem_reap_now(arc_reclaim_strategy_t strat, uint64_t bytes) kmem_cache_reap_now(buf_cache); kmem_cache_reap_now(hdr_full_cache); kmem_cache_reap_now(hdr_l2only_cache); + kmem_cache_reap_now(range_seg_cache); } /* diff --git a/module/zfs/range_tree.c b/module/zfs/range_tree.c index 22175e06ab..6422fd1c1f 100644 --- a/module/zfs/range_tree.c +++ b/module/zfs/range_tree.c @@ -33,7 +33,7 @@ #include #include -static kmem_cache_t *range_seg_cache; +kmem_cache_t *range_seg_cache; void range_tree_init(void)