Skip to content

Commit

Permalink
zfs_putpages: use TXG_WAIT
Browse files Browse the repository at this point in the history
Explicit looping using TXG_NOWAIT is more verbose and may harm performance
under heavy load because of multiple waits.

MFC after:	1 week
  • Loading branch information
avg-I committed Mar 23, 2017
1 parent 3d775e1 commit 16b4657
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -4712,19 +4712,13 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t len, int flags,
goto out;
}

top:
tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_write(tx, zp->z_id, off, len);

dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
zfs_sa_upgrade_txholds(tx, zp);
err = dmu_tx_assign(tx, TXG_NOWAIT);
err = dmu_tx_assign(tx, TXG_WAIT);
if (err != 0) {
if (err == ERESTART) {
dmu_tx_wait(tx);
dmu_tx_abort(tx);
goto top;
}
dmu_tx_abort(tx);
goto out;
}
Expand Down

0 comments on commit 16b4657

Please sign in to comment.