mirror_zfs/module
Alexander Motin c1b5869bab
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 <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Author: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12300
2021-07-16 13:39:24 -06:00
..
avl Remove avl_size field from struct avl_tree 2021-07-01 09:32:31 -06:00
icp Replace ZoL with OpenZFS where applicable 2021-05-07 17:20:37 -07:00
lua cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
nvpair Links in Source Files 2020-09-02 09:42:12 -07:00
os Fix ARC ghost states eviction accounting 2021-07-13 09:41:59 -06:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode Fix various typos 2021-04-02 18:52:15 -07:00
zcommon libzfs: add keylocation=https://, backed by fetch(3) or libcurl 2021-05-12 21:21:35 -07:00
zfs Introduce dsl_dir_diduse_transfer_space() 2021-07-16 13:39:24 -06:00
zstd Fix build with KASAN 2021-06-25 22:28:12 -07:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add zstd support to zfs 2020-08-20 10:30:06 -07:00
Makefile.bsd Restore FreeBSD resource usage accounting 2021-02-19 22:34:33 -08:00
Makefile.in FreeBSD module --enable-debug --enable-invariants 2021-03-05 12:16:41 -08:00