diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_malloc.c | 10 | ||||
-rw-r--r-- | sys/kern/subr_pool.c | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index c583d69e9fc..1862aa171cd 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_malloc.c,v 1.105 2014/03/28 17:57:11 mpi Exp $ */ +/* $OpenBSD: kern_malloc.c,v 1.106 2014/04/03 21:36:59 tedu Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* @@ -180,14 +180,18 @@ malloc(unsigned long size, int type, int flags) KASSERT(flags & (M_WAITOK | M_NOWAIT)); -#ifdef DIAGNOSTIC if ((flags & M_NOWAIT) == 0) { +#ifdef DIAGNOSTIC extern int pool_debug; assertwaitok(); if (pool_debug == 2) yield(); - } #endif + if (!cold) { + KERNEL_UNLOCK(); + KERNEL_LOCK(); + } + } #ifdef MALLOC_DEBUG if (debug_malloc(size, type, flags, (void **)&va)) { 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 |