summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-02-06 11:04:36 +0000
committerkib <kib@FreeBSD.org>2012-02-06 11:04:36 +0000
commit52c17430bc70cd8c1e6dc2ff5c7786cc3f4871e4 (patch)
treefae5558858b305702b78be385893645701a55d02 /sys/nfsclient
parent8b885b79f5441a9ccaf7101ad3dab74016626fe6 (diff)
downloadFreeBSD-src-52c17430bc70cd8c1e6dc2ff5c7786cc3f4871e4.zip
FreeBSD-src-52c17430bc70cd8c1e6dc2ff5c7786cc3f4871e4.tar.gz
Current implementations of sync(2) and syncer vnode fsync() VOP uses
mnt_noasync counter to temporary remove MNTK_ASYNC mount option, which is needed to guarantee a synchronous completion of the initiated i/o before syscall or VOP return. Global removal of MNTK_ASYNC option is harmful because not only i/o started from corresponding thread becomes synchronous, but all i/o is synchronous on the filesystem which is initiated during sync(2) or syncer activity. Instead of removing MNTK_ASYNC from mnt_kern_flag, provide a local thread flag to disable async i/o for current thread only. Use the opportunity to move DOINGASYNC() macro into sys/vnode.h and consistently use it through places which tested for MNTK_ASYNC. Some testing demonstrated 60-70% improvements in run time for the metadata-intensive operations on async-mounted UFS volumes, but still with great deviation due to other reasons. Reviewed by: mckusick Tested by: scottl MFC after: 2 weeks
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_vnops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 4ba1f7b..5cdf2dd 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -1448,7 +1448,7 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
tsiz -= len;
}
nfsmout:
- if (vp->v_mount->mnt_kern_flag & MNTK_ASYNC)
+ if (DOINGASYNC(vp))
committed = NFSV3WRITE_FILESYNC;
*iomode = committed;
if (error)
OpenPOWER on IntegriCloud