summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-10-14 19:43:37 +0000
committerkib <kib@FreeBSD.org>2012-10-14 19:43:37 +0000
commitcc37fedcd0324cd8e44b810a580a7e9fcdd26f99 (patch)
treee5202103aa2aae9dd9bd65c2fb10665b306571b3 /sys/kern/subr_trap.c
parent9b9c40ae6f4bb8aa77c9f7e392a4384ca2242fe7 (diff)
downloadFreeBSD-src-cc37fedcd0324cd8e44b810a580a7e9fcdd26f99.zip
FreeBSD-src-cc37fedcd0324cd8e44b810a580a7e9fcdd26f99.tar.gz
Add a KPI to allow to reserve some amount of space in the numvnodes
counter, without actually allocating the vnodes. The supposed use of the getnewvnode_reserve(9) is to reclaim enough free vnodes while the code still does not hold any resources that might be needed during the reclamation, and to consume the slack later for getnewvnode() calls made from the innards. After the critical block is finished, the caller shall free any reserve left, by getnewvnode_drop_reserve(9). Reviewed by: avg Tested by: pho MFC after: 1 week
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 24960fd..66e3201 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -154,6 +154,8 @@ userret(struct thread *td, struct trapframe *frame)
("userret: Returning with sleep disabled"));
KASSERT(td->td_pinned == 0,
("userret: Returning with with pinned thread"));
+ KASSERT(td->td_vp_reserv == 0,
+ ("userret: Returning while holding vnode reservation"));
#ifdef VIMAGE
/* Unfortunately td_vnet_lpush needs VNET_DEBUG. */
VNET_ASSERT(curvnet == NULL,
OpenPOWER on IntegriCloud