Skip to content

Commit

Permalink
zfs: zstd: short-circuit cleaning buffers if none exist
Browse files Browse the repository at this point in the history
This avoids a barrage of locking every minute.
  • Loading branch information
mjguzik authored and bsdjhb committed Jul 12, 2023
1 parent ed349fa commit c59bcbc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions module/zstd/zfs_zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,13 @@ zstd_mempool_deinit(void)
void
zfs_zstd_cache_reap_now(void)
{

/*
* Short-circuit if there are no buffers to begin with.
*/
if (ZSTDSTAT(zstd_stat_buffers) == 0)
return;

/*
* calling alloc with zero size seeks
* and releases old unused objects
Expand Down

0 comments on commit c59bcbc

Please sign in to comment.