summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-01-24 09:54:42 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-01-24 09:54:42 +0000
commit5c476338df5d9653347883b7f8763b28e631c178 (patch)
tree98bfef8028ff767ba891f61ea1aa82dd9b4fd3bc /sys
parent150e889f07cee281707f9db53538d11a10234313 (diff)
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')
-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) {