diff options
author | Alexander Motin <[email protected]> | 2021-07-16 15:39:24 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-16 13:39:24 -0600 |
commit | c1b5869bab987711ed00c3b5b43ee7145d332003 (patch) | |
tree | 2ebd2d0b0c399803c713a0658bc0f2560652572b /include/sys | |
parent | 41eba770616c36126cba3468a1781d212d3afb9d (diff) |
Introduce dsl_dir_diduse_transfer_space()
Most of dsl_dir_diduse_space() and dsl_dir_transfer_space() CPU time
is a dd_lock overhead and time spent in dmu_buf_will_dirty(). Calling
them one after another is a waste of time and even more contention.
Doing that twice for each rewritten block within dbuf_write_done()
via dsl_dataset_block_kill() and dsl_dataset_block_born() created one
of the biggest CPU overheads in case of small blocks rewrite.
dsl_dir_diduse_transfer_space() combines functionality of these two
functions for cases where it is needed, but without double overhead,
practically for the cost of dsl_dir_diduse_space() or even cheaper.
While there, optimize dsl_dir_phys() calls in dsl_dir_diduse_space()
and dsl_dir_transfer_space(). It seems Clang detects some aliasing
there, repeating dd->dd_dbuf->db_data dereference multiple times,
increasing dd_lock scope and contention.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Matthew Ahrens <[email protected]>
Author: Ryan Moeller <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Closes #12300
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/dsl_dir.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sys/dsl_dir.h b/include/sys/dsl_dir.h index 7cf5093c2..d635b3140 100644 --- a/include/sys/dsl_dir.h +++ b/include/sys/dsl_dir.h @@ -174,6 +174,9 @@ void dsl_dir_diduse_space(dsl_dir_t *dd, dd_used_t type, int64_t used, int64_t compressed, int64_t uncompressed, dmu_tx_t *tx); void dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta, dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx); +void dsl_dir_diduse_transfer_space(dsl_dir_t *dd, int64_t used, + int64_t compressed, int64_t uncompressed, int64_t tonew, + dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx); int dsl_dir_set_quota(const char *ddname, zprop_source_t source, uint64_t quota); int dsl_dir_set_reservation(const char *ddname, zprop_source_t source, |