summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-01-24 09:54:41 +0000
committermpi <mpi@openbsd.org>2017-01-24 09:54:41 +0000
commit47efcd19c011c576d0197507f74c731658ecdb6c (patch)
treeca96ace6db1d0ad22f90ff4cc7872c567e02d7d6 /sys/kern/subr_pool.c
parentSVM: misspelled field name in vmcb struct (renamed to match SVM code I'm (diff)
downloadwireguard-openbsd-47efcd19c011c576d0197507f74c731658ecdb6c.tar.xz
wireguard-openbsd-47efcd19c011c576d0197507f74c731658ecdb6c.zip
Force a context switch for every pool_get(9) with the PR_WAITOK flag
if pool_debug is equal to 2, just like we do for malloc(9). ok dlg@
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r--sys/kern/subr_pool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index a5f0cfb577a..06955059936 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.204 2016/11/21 01:44:06 dlg Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.205 2017/01/24 09:54:41 mpi Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -513,7 +513,7 @@ pool_get(struct pool *pp, int flags)
}
mtx_leave(&pp->pr_mtx);
- if (slowdown && ISSET(flags, PR_WAITOK))
+ if ((slowdown || pool_debug == 2) && ISSET(flags, PR_WAITOK))
yield();
if (v == NULL) {