Files
mirror_zfs/include/sys
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
..
2022-05-10 10:18:51 -07:00
2022-05-10 10:18:51 -07:00
2022-05-10 10:18:51 -07:00
2022-05-10 10:18:51 -07:00
2022-05-25 09:18:49 -07:00
2021-07-27 16:05:47 -07:00
2021-07-27 16:05:47 -07:00
2021-06-07 09:02:47 -07:00
2021-07-26 12:07:53 -07:00
2019-07-26 10:54:14 -07:00
2019-07-26 10:54:14 -07:00
2019-06-19 09:48:12 -07:00
2022-06-24 13:55:58 -07:00
2021-05-27 14:27:29 -06:00
2021-03-22 12:34:58 -07:00
2019-06-19 09:48:12 -07:00
2022-05-24 09:46:35 -07:00
2022-04-26 10:44:21 -07:00
2019-06-24 16:44:01 -07:00
2019-07-26 10:54:14 -07:00
2021-07-26 12:07:53 -07:00
2022-05-24 09:46:35 -07:00
2022-06-24 09:50:37 -07:00
2013-11-04 11:17:48 -08:00
2017-10-11 16:54:48 -04:00
2022-04-26 10:44:21 -07:00
2022-04-26 10:44:21 -07:00
2021-06-10 10:42:31 -06:00
2019-06-19 09:48:12 -07:00
2020-07-29 16:35:33 -07:00
2020-07-29 16:35:33 -07:00
2022-01-14 15:37:55 -08:00
2022-05-18 10:25:33 -07:00
2019-08-30 09:53:15 -07:00
2021-07-01 09:20:27 -06:00
2020-10-02 17:44:10 -07:00
2017-07-13 13:54:00 -04:00
2021-02-20 20:16:50 -08:00
2013-11-04 10:55:25 -08:00
2022-01-04 16:46:32 -08:00
2019-03-29 09:13:20 -07:00
2022-01-04 16:46:32 -08:00
2021-04-02 18:52:15 -07:00
2020-06-09 10:15:08 -07:00
2021-11-30 07:46:25 -07:00
2022-05-31 12:04:39 -07:00
2018-02-08 15:28:18 -08:00
2018-02-08 15:28:18 -08:00
2022-05-13 10:15:31 -07:00
2021-06-22 21:53:45 -07:00
2018-05-29 16:00:33 -07:00
2021-01-20 21:27:30 -08:00
2022-02-22 13:06:43 -08:00
2020-08-20 10:30:06 -07:00
2020-08-20 10:30:06 -07:00
2020-07-03 11:05:50 -07:00