zfs: zstd: short-circuit cleaning buffers if none exist

This avoids a barrage of locking every minute.
This commit is contained in:
Mateusz Guzik 2020-11-02 17:39:59 +00:00
parent e1b6a7f83f
commit 36639c3942
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367276

View File

@ -700,6 +700,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