summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2008-11-24 21:36:08 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2008-11-24 21:36:08 +0000
commit12d1b442cfa744367751bd0ac29900b4f5d31361 (patch)
tree45059b8628783e90d7c3a54c6007e4eccf818161 /sys
parentb297107577750489cac4e25344945858dffdd910 (diff)
Protect kmem_map allocations with splvm.
This should make dlg happy.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_pool.c15
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 *