From e6d7ceae15f295d15d5d43a81b1fa41e9fcdb3cc Mon Sep 17 00:00:00 2001 From: chs Date: Fri, 9 Jan 2004 08:49:42 +0000 Subject: [PATCH] make sure we free the context for the pmap in pmap_destroy(). this usually isn't necessary since we freed it earlier in pmap_remove_all(), but since uvmspace_free() is now called in the context of the exiting process, a new context might be allocated if uvm_unmap_detach() decides to sleep (since cpu_switch() will allocate a new context when it switches back to the exiting process). --- sys/arch/sparc64/sparc64/pmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index b81119a11b39..17453817c4e0 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.152 2004/01/06 09:38:20 petrov Exp $ */ +/* $NetBSD: pmap.c,v 1.153 2004/01/09 08:49:42 chs Exp $ */ /* * * Copyright (C) 1996-1999 Eduardo Horvath. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.152 2004/01/06 09:38:20 petrov Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.153 2004/01/09 08:49:42 chs Exp $"); #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ #define HWREF @@ -1543,6 +1543,7 @@ pmap_destroy(pm) return; } DPRINTF(PDB_DESTROY, ("pmap_destroy: freeing pmap %p\n", pm)); + ctx_free(pm); /* we could be a little smarter and leave pages zeroed */ for (pg = TAILQ_FIRST(&pm->pm_obj.memq); pg != NULL; pg = nextpg) {