From 9907ad3fee04706157cd0e2da2bb86047e1e7e28 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 11 Oct 2008 16:49:57 +0000 Subject: 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@ --- sys/kern/kern_malloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') 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"); -- cgit v1.2.3