txg_wait_synced_flags: add TXG_WAIT_SUSPEND flag to not wait if pool suspended

This allows a caller to request a wait for txg sync, with an appropriate
error return if the pool is suspended or becomes suspended during the
wait.

To support this, txg_wait_kick() is added to signal the sync condvar,
which wakes up the waiters, causing them to loop and reconsider their
wait conditions again. zio_suspend() now calls this to trigger the break
if the pool suspends while waiting.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #17355
This commit is contained in:
Rob Norris
2025-02-24 13:56:08 +11:00
committed by Brian Behlendorf
parent 8487945034
commit 468d22d60c
3 changed files with 31 additions and 1 deletions
+2
View File
@@ -2714,6 +2714,8 @@ zio_suspend(spa_t *spa, zio_t *zio, zio_suspend_reason_t reason)
}
mutex_exit(&spa->spa_suspend_lock);
txg_wait_kick(spa->spa_dsl_pool);
}
int