summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-10-11 16:49:57 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-10-11 16:49:57 +0000
commit9907ad3fee04706157cd0e2da2bb86047e1e7e28 (patch)
tree299e3ff4d7488a05b3eb01d00fe3d8faa0752bd6 /sys
parent93577e9c9777ad5e801491d988d6022282075570 (diff)
Since malloc_page_alloc() is a pool allocator it should check for PR_WAITOK
instead of M_NOWAIT. Checking for M_NOWAIT made many malloc calls that used that flag actually wait. This probably explains many if the strange hangs people have seen recently. ok miod@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_malloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index bd30a1b8611..dddba5b7735 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.76 2008/10/05 11:12:19 miod Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.77 2008/10/11 16:49:56 kettenis Exp $ */
/*
* Copyright (c) 2008 Michael Shalayeff
@@ -137,10 +137,11 @@ struct pool_allocator pool_allocator_malloc = {
void *
malloc_page_alloc(struct pool *pp, int flags)
{
- void *v = uvm_km_getpage(flags & M_NOWAIT? 0 : 1);
+ void *v;
struct vm_page *pg;
paddr_t pa;
+ v = uvm_km_getpage((flags & PR_WAITOK) ? TRUE : FALSE);
if (!pmap_extract(pmap_kernel(), (vaddr_t)v, &pa))
panic("malloc_page_alloc: pmap_extract failed");