mirror_zfs/include
Alexander Motin 1c0c729ab4
Several sorted scrub optimizations
- Reduce size and comparison complexity of q_exts_by_size B-tree.
Previous code used two 64-bit divisions and many other operations to
compare two B-tree elements.  It created enormous overhead.  This
implementation moves the math to the upper level and stores the score
in the B-tree elements themselves.  Since all that we need to store in
that B-tree is the extent score and offset, those can fit into single
8 byte value instead of 24 bytes of q_exts_by_addr element and can be
compared with single operation.
 - Better decouple secondary tree logic from main range_tree by moving
rt_btree_ops and related functions into dsl_scan.c as ext_size_ops.
Those functions are very small to worry about the code duplication and
range_tree does not need to know details such as rt_btree_compare.
 - Instead of accounting number of pending bytes per pool, that needs
atomic on global variable per block, account the number of non-empty
per-vdev queues, that change much more rarely.
 - When extent scan is interrupted by TXG end, continue it in the next
TXG instead of selecting next best extent.  It allows to avoid leaving
one truncated (and so likely not the best any more) extent each TXG.

On top of some other optimizations this saves about 1.5 minutes out of
10 to scrub pool of 12 SSDs, storing 1.5TB of 4KB zvol blocks.

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tom Caputi <caputit1@tcnj.edu>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #13576
2022-06-24 09:50:37 -07:00
..
os Add support for ARCH=um for x86 sub-architectures 2022-06-15 14:22:52 -07:00
sys Several sorted scrub optimizations 2022-06-24 09:50:37 -07:00
.gitignore OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
cityhash.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
libnvpair.h lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 2021-06-09 17:04:32 -07:00
libuutil_common.h Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
libuutil_impl.h Replace /*PRINTFLIKEn*/ with attribute(printf) 2021-07-26 12:07:15 -07:00
libuutil.h Switch from _Noreturn to __attribute__((noreturn)) 2022-03-23 08:51:00 -07:00
libzfs_core.h libzfs, libzfs_core: send: always write to pipe 2022-03-08 09:33:08 -08:00
libzfs.h Add Linux namespace delegation support 2022-06-10 09:51:46 -07:00
libzfsbootenv.h lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden 2021-06-09 17:04:32 -07:00
libzutil.h libzfs: constify zfs_strip_partition(), zfs_strip_path() 2022-05-16 15:56:53 -07:00
Makefile.am Introduce BLAKE3 checksums as an OpenZFS feature 2022-06-08 15:55:57 -07:00
thread_pool.h libspl/include: remove unused/empty headers 2022-05-18 12:10:43 -07:00
zfeature_common.h Introduce BLAKE3 checksums as an OpenZFS feature 2022-06-08 15:55:57 -07:00
zfs_comutil.h module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_deleg.h module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_fletcher.h Add --enable-asan and --enable-ubsan switches 2022-02-03 14:35:38 -08:00
zfs_namecheck.h libzfs: convert to -fvisibility=hidden 2021-06-03 13:17:55 -07:00
zfs_prop.h Flex non-pretty-printed properties and raw-/pretty-print remaining ones 2022-03-04 12:08:33 -08:00