svn commit: r239838 - stable/9/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Wed Aug 29 15:28:39 UTC 2012
Author: kib
Date: Wed Aug 29 15:28:38 2012
New Revision: 239838
URL: http://svn.freebsd.org/changeset/base/239838
Log:
MFC r236516:
Count and export the number of prefaulting happen.
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:21:27 2012 (r239837)
+++ stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:28:38 2012 (r239838)
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include <sys/filio.h>
#include <sys/resourcevar.h>
#include <sys/sx.h>
+#include <sys/sysctl.h>
#include <sys/ttycom.h>
#include <sys/conf.h>
#include <sys/syslog.h>
@@ -766,6 +767,9 @@ unlock:
}
static const int io_hold_cnt = 16;
+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");
/*
* The vn_io_fault() is a wrapper around vn_read() and vn_write() to
@@ -863,6 +867,7 @@ vn_io_fault(struct file *fp, struct uio
if (error != EFAULT)
goto out;
+ atomic_add_long(&vn_io_faults_cnt, 1);
uio_clone->uio_segflg = UIO_NOCOPY;
uiomove(NULL, resid - uio->uio_resid, uio_clone);
uio_clone->uio_segflg = uio->uio_segflg;
More information about the svn-src-stable-9
mailing list