Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm fix uarea_system_poolpage_free() to handle freeing a...



details:   https://anonhg.NetBSD.org/src/rev/ed4a9c7354e2
branches:  trunk
changeset: 778613:ed4a9c7354e2
user:      chs <chs%NetBSD.org@localhost>
date:      Fri Apr 06 17:16:30 2012 +0000

description:
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.

diffstat:

 sys/uvm/uvm_glue.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r a97f1c6801b6 -r ed4a9c7354e2 sys/uvm/uvm_glue.c
--- a/sys/uvm/uvm_glue.c        Fri Apr 06 17:12:45 2012 +0000
+++ b/sys/uvm/uvm_glue.c        Fri Apr 06 17:16:30 2012 +0000
@@ -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 @@
 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 = {



Home | Main Index | Thread Index | Old Index