broke out panics for *_map too small, and tried to coalesce the maps more

often.
This commit is contained in:
cgd 1993-03-31 21:53:56 +00:00
parent cac8c9b73b
commit 64354bb7c6
1 changed files with 11 additions and 5 deletions

View File

@ -214,6 +214,7 @@ void kmem_free(map, addr, size)
vm_size_t size;
{
(void) vm_map_remove(map, trunc_page(addr), round_page(addr + size));
vm_map_simplify(map, addr);
}
/*
@ -361,17 +362,21 @@ kmem_malloc(map, size, canwait)
vm_page_t m;
extern vm_object_t kmem_object;
if (map != kmem_map && map != mb_map && map != buffer_map)
panic("kern_malloc_alloc: map != {kmem,mb,buffer}_map");
if (map != kmem_map && map != mb_map)
panic("kern_malloc_alloc: map != {kmem,mb}_map");
size = round_page(size);
addr = vm_map_min(map);
if (vm_map_find(map, NULL, (vm_offset_t)0,
&addr, size, TRUE) != KERN_SUCCESS) {
if (canwait)
panic("kmem_malloc: kmem_map too small");
return(0);
if (canwait) { /* XXX -- then we should wait */
if (map == kmem_map)
panic("kmem_malloc: kmem_map too small");
else if (map == mb_map)
printf("kmem_malloc: mb_map too small (can't wait)\n");
}
return 0;
}
/*
@ -576,6 +581,7 @@ void kmem_free_wakeup(map, addr, size)
(void) vm_map_delete(map, trunc_page(addr), round_page(addr + size));
thread_wakeup((int)map);
vm_map_unlock(map);
vm_map_simplify(map, addr);
}
/*