From bb832157add710b06c3ed8a68b96c86afd4bb4d3 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 20 Nov 2025 15:44:12 -0500 Subject: [PATCH] DDT: Make children writes inherit allocator Even though unlike gang children it is not so critical for dedup children to inherit parent's allocator, there is still no reason for them to have allocation policy different from normal writes. Signed-off-by: Alexander Motin --- module/zfs/zio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 74373f759cec..d990d2dd6d09 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -3088,7 +3088,7 @@ zio_gang_issue(zio_t *zio) } static void -zio_gang_inherit_allocator(zio_t *pio, zio_t *cio) +zio_inherit_allocator(zio_t *pio, zio_t *cio) { cio->io_allocator = pio->io_allocator; } @@ -3223,7 +3223,7 @@ zio_write_gang_block(zio_t *pio, metaslab_class_t *mc) zio_write_gang_done, NULL, pio->io_priority, ZIO_GANG_CHILD_FLAGS(pio), &pio->io_bookmark); - zio_gang_inherit_allocator(pio, zio); + zio_inherit_allocator(pio, zio); if (pio->io_flags & ZIO_FLAG_ALLOC_THROTTLED) { boolean_t more; VERIFY(metaslab_class_throttle_reserve(mc, zio->io_allocator, @@ -3285,7 +3285,7 @@ zio_write_gang_block(zio_t *pio, metaslab_class_t *mc) (allocated ? ZIO_FLAG_PREALLOCATED : 0), &pio->io_bookmark); resid -= psize; - zio_gang_inherit_allocator(zio, cio); + zio_inherit_allocator(zio, cio); if (allocated) { metaslab_trace_move(&cio_list, &cio->io_alloc_list); metaslab_group_alloc_increment_all(spa, @@ -4062,6 +4062,7 @@ zio_ddt_write(zio_t *zio) zio_ddt_child_write_ready, NULL, zio_ddt_child_write_done, dde, zio->io_priority, ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark); + zio_inherit_allocator(zio, cio); zio_push_transform(cio, zio->io_abd, zio->io_size, 0, NULL);