summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-07-10 07:50:27 +0000
committertedu <tedu@openbsd.org>2014-07-10 07:50:27 +0000
commit54d86b476bf804fb354033455bdbc3be7ba37099 (patch)
tree38e6549868228e14261cf86f1507e7f4cf7ce902
parentBN_free, BN_clear_free, BN_CTX_free, BN_BLINDING_free and BN_MONT_CTX_free (diff)
downloadwireguard-openbsd-54d86b476bf804fb354033455bdbc3be7ba37099.tar.xz
wireguard-openbsd-54d86b476bf804fb354033455bdbc3be7ba37099.zip
hide the biglock thrashing under pool_debug so it can be turned off
-rw-r--r--sys/kern/kern_malloc.c4
-rw-r--r--sys/kern/subr_pool.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 0e5397a0980..32b710db856 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.108 2014/06/21 19:24:57 daniel Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.109 2014/07/10 07:50:27 tedu Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
@@ -183,7 +183,7 @@ malloc(unsigned long size, int type, int flags)
if (pool_debug == 2)
yield();
#endif
- if (!cold) {
+ if (!cold && pool_debug) {
KERNEL_UNLOCK();
KERNEL_LOCK();
}
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 64dd72bbe16..09e17f38e98 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.136 2014/07/03 07:47:56 guenther Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.137 2014/07/10 07:50:27 tedu Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -485,7 +485,7 @@ pool_get(struct pool *pp, int flags)
if (pool_debug == 2)
yield();
#endif
- if (!cold) {
+ if (!cold && pool_debug) {
KERNEL_UNLOCK();
KERNEL_LOCK();
}