summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-02-17 19:53:41 +0000
committerdim <dim@FreeBSD.org>2015-02-17 19:53:41 +0000
commitd27bd4650ea928097e260433cb5c69be0dda440f (patch)
tree9b840acec4a7a5a64b3092e4f4cbb8197e629360 /sys/kern/vfs_subr.c
parent9377b5ad0feb5dd018ed6cfc6378ac19c1252dfe (diff)
parent68a4902d98c88ebff2f1dfd8bee849d62233ba60 (diff)
downloadFreeBSD-src-d27bd4650ea928097e260433cb5c69be0dda440f.zip
FreeBSD-src-d27bd4650ea928097e260433cb5c69be0dda440f.tar.gz
Merge ^/head r278756 through r278915.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 912863e..cfa8f45 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -122,6 +122,10 @@ static unsigned long numvnodes;
SYSCTL_ULONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0,
"Number of vnodes in existence");
+static u_long vnodes_created;
+SYSCTL_ULONG(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created,
+ 0, "Number of vnodes created by getnewvnode");
+
/*
* Conversion tables for conversion from vnode types to inode formats
* and back.
@@ -156,6 +160,10 @@ static int vlru_allow_cache_src;
SYSCTL_INT(_vfs, OID_AUTO, vlru_allow_cache_src, CTLFLAG_RW,
&vlru_allow_cache_src, 0, "Allow vlru to reclaim source vnode");
+static u_long recycles_count;
+SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0,
+ "Number of vnodes recycled to avoid exceding kern.maxvnodes");
+
/*
* Various variables used for debugging the new implementation of
* reassignbuf().
@@ -788,6 +796,7 @@ vlrureclaim(struct mount *mp)
}
KASSERT((vp->v_iflag & VI_DOOMED) == 0,
("VI_DOOMED unexpectedly detected in vlrureclaim()"));
+ atomic_add_long(&recycles_count, 1);
vgonel(vp);
VOP_UNLOCK(vp, 0);
vdropl(vp);
@@ -988,8 +997,10 @@ vtryrecycle(struct vnode *vp)
__func__, vp);
return (EBUSY);
}
- if ((vp->v_iflag & VI_DOOMED) == 0)
+ if ((vp->v_iflag & VI_DOOMED) == 0) {
+ atomic_add_long(&recycles_count, 1);
vgonel(vp);
+ }
VOP_UNLOCK(vp, LK_INTERLOCK);
vn_finished_write(vnmp);
return (0);
@@ -1093,6 +1104,7 @@ getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops,
atomic_add_long(&numvnodes, 1);
mtx_unlock(&vnode_free_list_mtx);
alloc:
+ atomic_add_long(&vnodes_created, 1);
vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK|M_ZERO);
/*
* Setup locks.
@@ -3191,6 +3203,7 @@ DB_SHOW_COMMAND(mount, db_show_mount)
db_printf(" mnt_maxsymlinklen = %d\n", mp->mnt_maxsymlinklen);
db_printf(" mnt_iosize_max = %d\n", mp->mnt_iosize_max);
db_printf(" mnt_hashseed = %u\n", mp->mnt_hashseed);
+ db_printf(" mnt_lockref = %d\n", mp->mnt_lockref);
db_printf(" mnt_secondary_writes = %d\n", mp->mnt_secondary_writes);
db_printf(" mnt_secondary_accwrites = %d\n",
mp->mnt_secondary_accwrites);
OpenPOWER on IntegriCloud