HomeFreeBSD

vdev_file: make FLUSH and TRIM asynchronous

Description

vdev_file: make FLUSH and TRIM asynchronous

zfs_file_fsync() and zfs_file_deallocate() are both blocking ops, so the
zio_taskq thread is active and blocked both while waiting for the IO
call and then while calling zio_execute() for the next stage. This is a
particular issue for FLUSH, as the z_flush_iss queue typically only has
one thread; multiple flushes arriving at once can cause long delays if
the underlying fsync() response is particularly slow.

To fix this, we dispatch both FLUSH and TRIM to the z_vdev_file taskq,
just as we do for reads and writes. Further, we return all results
through zio_interrupt(), so neither the issue nor the file taskqs are
blocked.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #17064

Details

Provenance
rob.norris_klarasystems.comAuthored on Sat, Feb 22, 7:16 PM
GitHub <noreply@github.com>Committed on Sat, Feb 22, 7:16 PM
Parents
rG682c5f6a0a43: Fix wrong free function in arc_hdr_decrypt
Branches
Unknown
Tags
Unknown