summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-10-14 00:51:40 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-10-14 00:51:40 +0200
commitefc3d9c47cd744c316a8521c9a29fa274b507d26 (patch)
treea33cd3024ffec04ef5c415017132473e606926c2 /kern
parent6b146e80e1841b0a8c9788b2bbb9b7c16a158f6d (diff)
Fix allocation failure during gc
kern/zalloc.c (zone_gc): Allocate and free a vm_map_kentry_zone element to make sure the gc will be able to allocate one for vm_map_delete.
Diffstat (limited to 'kern')
-rw-r--r--kern/zalloc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kern/zalloc.c b/kern/zalloc.c
index 9b3ac4b..1a70e4c 100644
--- a/kern/zalloc.c
+++ b/kern/zalloc.c
@@ -828,6 +828,15 @@ static void zone_gc(void)
free_addr = zone_map_min_address +
PAGE_SIZE * (freep - zone_page_table);
+
+ /* Hack Hack */
+ /* Needed to make vm_map_delete's vm_map_clip_end always be
+ * able to get an element without having to call zget_space and
+ * hang because zone_map is already locked by vm_map_delete */
+
+ extern zone_t vm_map_kentry_zone; /* zone for kernel entry structures */
+ zfree(vm_map_kentry_zone, zalloc(vm_map_kentry_zone));
+
kmem_free(zone_map, free_addr, PAGE_SIZE);
}
}