HomeFreeBSD

zfs_ioc_send: use a dedicated taskq thread for send

Description

zfs_ioc_send: use a dedicated taskq thread for send

When stack space is tight, the stream is written to its target on a
separate taskq thread to make sure there's enough stack space to
complete it.

This has always used an IO taskq, but that doesn't really make sense for
it, and moving it onto a regular taskq lets us get rid of
spa_taskq_dispatch_sync(), which is not used anywhere else.

Stream writes may block for a long time depending on what the target is,
and we have no way of discovering this, so we can't risk using the
system taskq, as there may be many tens of sends in progress. Instead,
we create a dedicated taskq thread for each send writer to run on, and
clean it up when it's done.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16151

Details

Provenance
rob.norris_klarasystems.comAuthored on May 2 2024, 1:57 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on May 14 2024, 4:39 PM
Parents
rGb64afa41d56e: Better control the thread pool size when mounting datasets
Branches
Unknown
Tags
Unknown