]> git.proxmox.com Git - mirror_zfs.git/commit
Fix inflated quiesce time caused by lwb_tx during zil_commit()
authorKevin Jin <33590050+jxdking@users.noreply.github.com>
Thu, 26 May 2022 16:36:14 +0000 (12:36 -0400)
committerGitHub <noreply@github.com>
Thu, 26 May 2022 16:36:14 +0000 (09:36 -0700)
commit152d6fda54e61042a70059c95c44b364aea0bbd8
tree25bda55c56945d8872631e512772794ccd165608
parentd98a67a53a180bd88ec8d9aeea75d92e1c9968b5
Fix inflated quiesce time caused by lwb_tx during zil_commit()

In current zil_commit() process, transaction lwb_tx is assigned in
zil_lwb_write_issue(), and is committed in zil_lwb_flush_vdevs_done().
Thus, during lwb write out process, the txg is held in open or quiesing
state, until zil_lwb_flush_vdevs_done() is called. If the zil's zio
latency is high, it will cause txg_sync_thread() to starve.

The goal here is to defer waiting for zil_lwb_flush_vdevs_done to the
'syncing' txg state. That is, in zil_sync().

In this patch, it achieves the goal without holding transaction.
A new function zil_lwb_flush_wait_all() is introduced. It waits for
the completion of all the zil_lwb_flush_vdevs_done() by given txg.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Signed-off-by: jxdking <lostking2008@hotmail.com>
Closes #12321
include/sys/zil_impl.h
module/zfs/zil.c