Module Name: src
Committed By: chs
Date: Fri Apr 6 17:16:30 UTC 2012
Modified Files:
src/sys/uvm: uvm_glue.c
Log Message:
fix uarea_system_poolpage_free() to handle freeing a uarea
that was not allocated by cpu_uarea_alloc() (ie. on plaforms
where cpu_uarea_alloc() failing is not fatal).
fixes PR 46284.
To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/uvm/uvm_glue.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/uvm_glue.c
diff -u src/sys/uvm/uvm_glue.c:1.157 src/sys/uvm/uvm_glue.c:1.158
--- src/sys/uvm/uvm_glue.c:1.157 Mon Feb 20 12:21:23 2012
+++ src/sys/uvm/uvm_glue.c Fri Apr 6 17:16:30 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_glue.c,v 1.157 2012/02/20 12:21:23 martin Exp $ */
+/* $NetBSD: uvm_glue.c,v 1.158 2012/04/06 17:16:30 chs Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.157 2012/02/20 12:21:23 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.158 2012/04/06 17:16:30 chs Exp $");
#include "opt_kgdb.h"
#include "opt_kstack.h"
@@ -315,8 +315,11 @@ uarea_system_poolpage_alloc(struct pool
static void
uarea_system_poolpage_free(struct pool *pp, void *addr)
{
- if (!cpu_uarea_free(addr))
- panic("%s: failed to free uarea %p", __func__, addr);
+ if (cpu_uarea_free(addr))
+ return;
+
+ uvm_km_free(kernel_map, (vaddr_t)addr, pp->pr_alloc->pa_pagesz,
+ UVM_KMF_WIRED);
}
static struct pool_allocator uvm_uarea_system_allocator = {