Skip to content

Commit

Permalink
Illumos 5163 - arc should reap range_seg_cache
Browse files Browse the repository at this point in the history
5163 arc should reap range_seg_cache
Reviewed by: Christopher Siden <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Richard Elling <[email protected]>
Reviewed by: Saso Kiselkov <[email protected]>
Approved by: Dan McDonald <[email protected]>

References:
  https://www.illumos.org/issues/5163
  illumos/illumos-gate@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 <[email protected]>
  • Loading branch information
grwilson authored and behlendorf committed Jun 25, 2015
1 parent aa9af22 commit 669dedb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/sys/zfs_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/libspl/include/umem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
/*
Expand Down Expand Up @@ -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);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/range_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <sys/zio.h>
#include <sys/range_tree.h>

static kmem_cache_t *range_seg_cache;
kmem_cache_t *range_seg_cache;

void
range_tree_init(void)
Expand Down

0 comments on commit 669dedb

Please sign in to comment.