mirror_zfs/include
Alexander Motin c0bf952c84
Several B-tree optimizations
- Introduce first element offset within a leaf.  It allows to reduce
by ~50% average memmove() size when adding/removing elements.  If the
added/removed element is in the first half of the leaf, we may shift
elements before it and adjust the bth_first instead of moving more
elements after it.
 - Use memcpy() instead of memmove() when we know there is no overlap.
 - Switch from uint64_t to uint32_t.  It does not limit anything,
but 32-bit arches should appreciate it greatly in hot paths.
 - Store leaf capacity in struct btree to avoid 64-bit divisions.
 - Adjust zfs_btree_insert_into_leaf() to always result in balanced
leaves after splitting, no matter where the new element was inserted.
Not that we care about it much, but it should also allow B-trees with
as little as two elements per leaf instead of 4 previously.

When scrubbing pool of 12 SSDs, storing 1.5TB of 4KB zvol blocks this
reduces amount of time spent in memmove() inside the scan thread from
13.7% to 5.7% and total scrub time by ~15 seconds out of 9 minutes.
It should also reduce spacemaps load time, but I haven't measured it.

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #13582
2022-06-24 13:55:58 -07:00
..
os Add support for ARCH=um for x86 sub-architectures 2022-06-15 14:22:52 -07:00
sys Several B-tree optimizations 2022-06-24 13:55:58 -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