diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2008-11-24 21:36:08 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2008-11-24 21:36:08 +0000 |
commit | 12d1b442cfa744367751bd0ac29900b4f5d31361 (patch) | |
tree | 45059b8628783e90d7c3a54c6007e4eccf818161 /sys | |
parent | b297107577750489cac4e25344945858dffdd910 (diff) |
Protect kmem_map allocations with splvm.
This should make dlg happy.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_pool.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index b68bcd95e1b..c0db7c186d3 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.68 2008/11/24 17:42:34 art Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.69 2008/11/24 21:36:07 art Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -1402,15 +1402,24 @@ void * pool_large_alloc(struct pool *pp, int flags, int *slowdown) { int kfl = (flags & PR_WAITOK) ? 0 : UVM_KMF_NOWAIT; + vaddr_t va; + int s; - return ((void *)uvm_km_kmemalloc(kmem_map, NULL, - pp->pr_alloc->pa_pagesz, kfl)); + s = splvm(); + va = uvm_km_kmemalloc(kmem_map, NULL, pp->pr_alloc->pa_pagesz, kfl); + splx(s); + + return ((void *)va); } void pool_large_free(struct pool *pp, void *v) { + int s; + + s = splvm(); uvm_km_free(kmem_map, (vaddr_t)v, pp->pr_alloc->pa_pagesz); + splx(s); } void * |