zfs_putpages: use TXG_WAIT

Explicit looping using TXG_NOWAIT is more verbose and may harm performance
under heavy load because of multiple waits.

MFC after:	1 week
This commit is contained in:
Andriy Gapon 2017-03-23 09:13:21 +00:00
parent 3d775e193e
commit 16b46572fa

View File

@ -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;
}