svn commit: r239839 - stable/9/sys/kern

Konstantin Belousov kib at FreeBSD.org
Wed Aug 29 15:34:27 UTC 2012


Author: kib
Date: Wed Aug 29 15:34:26 2012
New Revision: 239839
URL: http://svn.freebsd.org/changeset/base/239839

Log:
  MFC r236517:
  Add a knob to disable vn_io_fault.
  
  MFC note: by default, vn_io_fault for stable/9 is disabled.

Modified:
  stable/9/sys/kern/vfs_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/vfs_vnops.c
==============================================================================
--- stable/9/sys/kern/vfs_vnops.c	Wed Aug 29 15:28:38 2012	(r239838)
+++ stable/9/sys/kern/vfs_vnops.c	Wed Aug 29 15:34:26 2012	(r239839)
@@ -767,6 +767,9 @@ unlock:
 }
 
 static const int io_hold_cnt = 16;
+static int vn_io_fault_enable = 0;
+SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RW,
+    &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance");
 static unsigned long vn_io_faults_cnt;
 SYSCTL_LONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD,
     &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers");
@@ -829,7 +832,8 @@ vn_io_fault(struct file *fp, struct uio 
 	vp = fp->f_vnode;
 	if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG ||
 	    ((mp = vp->v_mount) != NULL &&
-	    (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0))
+	    (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0) ||
+	    !vn_io_fault_enable)
 		return (doio(fp, uio, active_cred, flags, td));
 
 	/*


More information about the svn-src-stable mailing list