Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making sure the last quiesced txg is synced #8239

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 15 additions & 2 deletions module/zfs/txg.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ txg_sync_thread(void *arg)
tx_state_t *tx = &dp->dp_tx;
callb_cpr_t cpr;
clock_t start, delta;
boolean_t checked_quiescing = B_FALSE;

(void) spl_fstrans_mark();
txg_thread_enter(tx, &cpr);
Expand Down Expand Up @@ -549,8 +550,20 @@ txg_sync_thread(void *arg)
txg_thread_wait(tx, &cpr, &tx->tx_quiesce_done_cv, 0);
}

if (tx->tx_exiting)
txg_thread_exit(tx, &cpr, &tx->tx_sync_thread);
xwcal marked this conversation as resolved.
Show resolved Hide resolved
if (tx->tx_exiting) {
xwcal marked this conversation as resolved.
Show resolved Hide resolved
if (checked_quiescing) {
txg_thread_exit(tx, &cpr, &tx->tx_sync_thread);
} else {
while (tx->tx_threads != 1)
txg_thread_wait(tx, &cpr,
&tx->tx_exit_cv, 0);
if (tx->tx_quiesced_txg)
checked_quiescing = B_TRUE;
else
txg_thread_exit(tx, &cpr,
&tx->tx_sync_thread);
}
xwcal marked this conversation as resolved.
Show resolved Hide resolved
}

/*
* Consume the quiesced txg which has been handed off to
Expand Down