mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Implement allocation size ranges and use for gang leaves (#17111)
When forced to resort to ganging, ZFS currently allocates three child blocks, each one third of the size of the original. This is true regardless of whether larger allocations could be made, which would allow us to have fewer gang leaves. This improves performance when fragmentation is high enough to require ganging, but not so high that all the free ranges are only just big enough to hold a third of the recordsize. This is also useful for improving the behavior of a future change to allow larger gang headers. We add the ability for the allocation codepath to allocate a range of sizes instead of a single fixed size. We then use this to pre-allocate the DVAs for the gang children. If those allocations fail, we fall back to the normal write path, which will likely re-gang. Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com> Co-authored-by: Paul Dagnelie <paul.dagnelie@klarasystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Tony Hutter <hutter2@llnl.gov>
This commit is contained in:
@@ -103,7 +103,8 @@ typedef const struct vdev_ops {
|
||||
vdev_fini_func_t *vdev_op_fini;
|
||||
vdev_open_func_t *vdev_op_open;
|
||||
vdev_close_func_t *vdev_op_close;
|
||||
vdev_asize_func_t *vdev_op_asize;
|
||||
vdev_asize_func_t *vdev_op_psize_to_asize;
|
||||
vdev_asize_func_t *vdev_op_asize_to_psize;
|
||||
vdev_min_asize_func_t *vdev_op_min_asize;
|
||||
vdev_min_alloc_func_t *vdev_op_min_alloc;
|
||||
vdev_io_start_func_t *vdev_op_io_start;
|
||||
@@ -615,6 +616,7 @@ extern vdev_ops_t vdev_indirect_ops;
|
||||
*/
|
||||
extern void vdev_default_xlate(vdev_t *vd, const zfs_range_seg64_t *logical_rs,
|
||||
zfs_range_seg64_t *physical_rs, zfs_range_seg64_t *remain_rs);
|
||||
extern uint64_t vdev_default_psize(vdev_t *vd, uint64_t asize, uint64_t txg);
|
||||
extern uint64_t vdev_default_asize(vdev_t *vd, uint64_t psize, uint64_t txg);
|
||||
extern uint64_t vdev_default_min_asize(vdev_t *vd);
|
||||
extern uint64_t vdev_get_min_asize(vdev_t *vd);
|
||||
|
||||
Reference in New Issue
Block a user