diff options
author | 2015-09-08 13:37:21 +0000 | |
---|---|---|
committer | 2015-09-08 13:37:21 +0000 | |
commit | 13499c96e2694e274321ebf82bf157afe0e4d8db (patch) | |
tree | 964c856dc0e8ac430742d0a8b9d7ec3f84f3f1ba /sys/kern/subr_pool.c | |
parent | sizes for free(); ok semarie (diff) | |
download | wireguard-openbsd-13499c96e2694e274321ebf82bf157afe0e4d8db.tar.xz wireguard-openbsd-13499c96e2694e274321ebf82bf157afe0e4d8db.zip |
Now that msleep(9) no longer requires the kernel lock (as long as PCATCH
isn't specified) the default backend allocator implementation no longer
needs to grab the kernel lock.
ok visa@, guenther@
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r-- | sys/kern/subr_pool.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index c3820846c41..df542953c20 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.190 2015/09/06 20:58:14 kettenis Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.191 2015/09/08 13:37:21 kettenis Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -1431,24 +1431,11 @@ void * pool_page_alloc(struct pool *pp, int flags, int *slowdown) { struct kmem_dyn_mode kd = KMEM_DYN_INITIALIZER; - void *v; kd.kd_waitok = ISSET(flags, PR_WAITOK); kd.kd_slowdown = slowdown; - /* - * XXX Until we can call msleep(9) without holding the kernel - * lock. - */ - if (ISSET(flags, PR_WAITOK)) - KERNEL_LOCK(); - - v = km_alloc(pp->pr_pgsize, &kv_page, pp->pr_crange, &kd); - - if (ISSET(flags, PR_WAITOK)) - KERNEL_UNLOCK(); - - return (v); + return (km_alloc(pp->pr_pgsize, &kv_page, pp->pr_crange, &kd)); } void |