summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vnops.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-06-03 16:06:56 +0000
committerkib <kib@FreeBSD.org>2012-06-03 16:06:56 +0000
commitd977144831363366367c6984849c566bbe98e00b (patch)
tree5502fa9881c7282a9f947dec56e5b2cb62026a2b /sys/kern/vfs_vnops.c
parent39dac9db3fb36efedb810974a1931810cc8c91ff (diff)
downloadFreeBSD-src-d977144831363366367c6984849c566bbe98e00b.zip
FreeBSD-src-d977144831363366367c6984849c566bbe98e00b.tar.gz
Count and export the number of prefaulting happen.
MFC after: 1 month
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r--sys/kern/vfs_vnops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 06fd224..d5a6bf1 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -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>
@@ -696,6 +697,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
@@ -793,6 +797,7 @@ vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred,
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;
OpenPOWER on IntegriCloud