Skip to content

Commit

Permalink
Add abd_cache_reap_now for abd_chunk_cache users
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #10474
  • Loading branch information
mattmacy authored Jun 18, 2020
1 parent 4458157 commit 7564073
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/sys/abd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions module/os/freebsd/zfs/abd_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
5 changes: 5 additions & 0 deletions module/os/linux/zfs/abd_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
/*
Expand Down

0 comments on commit 7564073

Please sign in to comment.