From 7564073ed6344c12e6bc4ffabd130522d937fb93 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Wed, 17 Jun 2020 21:44:13 -0700 Subject: [PATCH] Add abd_cache_reap_now for abd_chunk_cache users Apparently missed in the initial port integration was the need to reap the abd_chunk_cache on FreeBSD. This change addresses that oversight. Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Matt Macy Closes #10474 --- include/sys/abd.h | 1 + module/os/freebsd/zfs/abd_os.c | 6 ++++++ module/os/linux/zfs/abd_os.c | 5 +++++ module/zfs/arc.c | 1 + 4 files changed, 13 insertions(+) diff --git a/include/sys/abd.h b/include/sys/abd.h index dad048af59..e9bd0e96f1 100644 --- a/include/sys/abd.h +++ b/include/sys/abd.h @@ -59,6 +59,7 @@ abd_t *abd_get_offset(abd_t *, size_t); abd_t *abd_get_offset_size(abd_t *, size_t, size_t); abd_t *abd_get_zeros(size_t); abd_t *abd_get_from_buf(void *, size_t); +void abd_cache_reap_now(void); /* * Conversion to and from a normal buffer diff --git a/module/os/freebsd/zfs/abd_os.c b/module/os/freebsd/zfs/abd_os.c index 5001747757..b4d43b96a0 100644 --- a/module/os/freebsd/zfs/abd_os.c +++ b/module/os/freebsd/zfs/abd_os.c @@ -488,3 +488,9 @@ abd_iter_unmap(struct abd_iter *aiter) aiter->iter_mapaddr = NULL; aiter->iter_mapsize = 0; } + +void +abd_cache_reap_now(void) +{ + kmem_cache_reap_soon(abd_chunk_cache); +} diff --git a/module/os/linux/zfs/abd_os.c b/module/os/linux/zfs/abd_os.c index d39f0c6d53..1754ce032f 100644 --- a/module/os/linux/zfs/abd_os.c +++ b/module/os/linux/zfs/abd_os.c @@ -920,6 +920,11 @@ abd_iter_unmap(struct abd_iter *aiter) aiter->iter_mapsize = 0; } +void +abd_cache_reap_now(void) +{ +} + #if defined(_KERNEL) /* * bio_nr_pages for ABD. diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 5717405d62..874cc02e89 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -4678,6 +4678,7 @@ arc_kmem_reap_soon(void) kmem_cache_reap_now(hdr_full_cache); kmem_cache_reap_now(hdr_l2only_cache); kmem_cache_reap_now(zfs_btree_leaf_cache); + abd_cache_reap_now(); if (zio_arena != NULL) { /*