summaryrefslogtreecommitdiff
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-04-03 21:37:00 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-04-03 21:37:00 +0000
commit4504cd982a1daa793107c70f1265768892ebef81 (patch)
tree756b524924e39d59cf2c1b2702fa8ca7e30f9c53 /sys/kern/subr_pool.c
parent6a027512e8bc0ebe46c29b5bb53d6469002fd208 (diff)
if it's ok to wait, it must also be ok to give the kernel lock. do so.
(then immediately reacquire it). this has the effect of giving interrupts on other CPUs to a chance to run and reduces latency in many cases. ok deraadt
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r--sys/kern/subr_pool.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 2fd1e897cfe..3e065b61bf1 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.125 2014/03/28 17:57:11 mpi Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.126 2014/04/03 21:36:59 tedu Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -478,13 +478,17 @@ pool_get(struct pool *pp, int flags)
KASSERT(flags & (PR_WAITOK | PR_NOWAIT));
-#ifdef DIAGNOSTIC
if ((flags & PR_WAITOK) != 0) {
+#ifdef DIAGNOSTIC
assertwaitok();
if (pool_debug == 2)
yield();
+#endif
+ if (!cold) {
+ KERNEL_UNLOCK();
+ KERNEL_LOCK();
+ }
}
-#endif /* DIAGNOSTIC */
mtx_enter(&pp->pr_mtx);
#ifdef POOL_DEBUG