From 16b46572fa997870e27cc8f39d60d4bccf0d39cc Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Thu, 23 Mar 2017 09:13:21 +0000 Subject: [PATCH] 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 --- .../contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index e8761381cf0..56825a8ff3d 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -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; }