svn commit: r367276 - head/sys/contrib/openzfs/module/zstd
Mateusz Guzik
mjg at FreeBSD.org
Mon Nov 2 17:40:00 UTC 2020
Author: mjg
Date: Mon Nov 2 17:39:59 2020
New Revision: 367276
URL: https://svnweb.freebsd.org/changeset/base/367276
Log:
zfs: zstd: short-circuit cleaning buffers if none exist
This avoids a barrage of locking every minute.
Modified:
head/sys/contrib/openzfs/module/zstd/zfs_zstd.c
Modified: head/sys/contrib/openzfs/module/zstd/zfs_zstd.c
==============================================================================
--- head/sys/contrib/openzfs/module/zstd/zfs_zstd.c Mon Nov 2 17:39:15 2020 (r367275)
+++ head/sys/contrib/openzfs/module/zstd/zfs_zstd.c Mon Nov 2 17:39:59 2020 (r367276)
@@ -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
More information about the svn-src-all
mailing list