HomeFreeBSD

Fix inflated quiesce time caused by lwb_tx during zil_commit()

Description

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

Details

Provenance
Kevin Jin <33590050+jxdking@users.noreply.github.com>Authored on May 26 2022, 4:36 PM
GitHub <noreply@github.com>Committed on May 26 2022, 4:36 PM
Parents
rGd98a67a53a18: Replace EXTRA_DIST with dist_noinst_DATA
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG152d6fda54e6: Fix inflated quiesce time caused by lwb_tx during zil_commit() (authored by Kevin Jin <33590050+jxdking@users.noreply.github.com>).May 26 2022, 4:36 PM