summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-02-03 08:06:13 +0000
committermav <mav@FreeBSD.org>2015-02-03 08:06:13 +0000
commit683ce518a8bf980a59801ed2b33474929b01cd19 (patch)
treec02e46c522a3f92959092fb2ea5d905291b9d57a /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
parentd98d4221cea35503f6cfc838cc7741d8aa49b3a1 (diff)
downloadFreeBSD-src-683ce518a8bf980a59801ed2b33474929b01cd19.zip
FreeBSD-src-683ce518a8bf980a59801ed2b33474929b01cd19.tar.gz
MFC r277419:
Allow skipping dmu_buf_will_dirty() call in dsl_dir_transfer_space(). dsl_dir_transfer_space() is mostly called after dsl_dir_diduse_space(), which already calls dmu_buf_will_dirty() for the same dbuf and tx, so its duplicate call in those cases will change nothing, only spend time. Skipping this call by four times reduces time spent in dbuf_write_done() and descendants, updating dataset statistics with several congested lock acquisitions. When rewriting 8K zvol blocks at 1GB/s rate, this reduces CPU time spent inside dbuf_write_done(), according to profiling, from 45% of 683K samples to 18% of 422K.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
index 5a891d1b..1862f8c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
@@ -1389,7 +1389,7 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_used_t type,
accounted_delta, compressed, uncompressed, tx);
dsl_dir_transfer_space(dd->dd_parent,
used - accounted_delta,
- DD_USED_CHILD_RSRV, DD_USED_CHILD, tx);
+ DD_USED_CHILD_RSRV, DD_USED_CHILD, NULL);
}
}
@@ -1397,7 +1397,7 @@ void
dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta,
dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx)
{
- ASSERT(dmu_tx_is_syncing(tx));
+ ASSERT(tx == NULL || dmu_tx_is_syncing(tx));
ASSERT(oldtype < DD_USED_NUM);
ASSERT(newtype < DD_USED_NUM);
@@ -1405,7 +1405,8 @@ dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta,
!(dsl_dir_phys(dd)->dd_flags & DD_FLAG_USED_BREAKDOWN))
return;
- dmu_buf_will_dirty(dd->dd_dbuf, tx);
+ if (tx != NULL)
+ dmu_buf_will_dirty(dd->dd_dbuf, tx);
mutex_enter(&dd->dd_lock);
ASSERT(delta > 0 ?
dsl_dir_phys(dd)->dd_used_breakdown[oldtype] >= delta :
OpenPOWER on IntegriCloud