diff options
author | Richard Braun <rbraun@sceen.net> | 2014-12-10 21:52:40 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-07-26 12:14:40 +0200 |
commit | 130fd1a913a98e2a0a3351103651c1193b9b5a07 (patch) | |
tree | ded2bbccdd52dfa536f4132bd3cabe4a11d8593a /vm/vm_map.c | |
parent | 79ab3cb110fe49b5a8fb4fdbbb15285287a13cf8 (diff) |
kern/slab: directmap update
The main impact of the direct physical mapping on the kmem module is the
slab size computation. The page allocator requires the allocation size
to be a power-of-two above the page size since it uses the buddy memory
allocation algorithm.
Custom slab allocation functions are no longer needed since the only
user was the kentry area, which has been removed recently.
The KMEM_CACHE_NOCPUPOOL flag is also no longer needed since CPU pools,
which are allocated from a kmem cache, can now always be allocated out
of the direct physical mapping.
Diffstat (limited to 'vm/vm_map.c')
-rw-r--r-- | vm/vm_map.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c index 4977bff..287bdfc 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -178,18 +178,23 @@ static vm_offset_t kentry_pagealloc(vm_size_t size) void vm_map_init(void) { - kmem_cache_init(&vm_map_cache, "vm_map", sizeof(struct vm_map), 0, - NULL, NULL, NULL, 0); - kmem_cache_init(&vm_map_entry_cache, "vm_map_entry", - sizeof(struct vm_map_entry), 0, NULL, NULL, NULL, 0); -#if 0 + kmem_cache_init (&vm_map_cache, + "vm_map", + sizeof(struct vm_map), 0, + NULL, 0); + kmem_cache_init (&vm_map_entry_cache, + "vm_map_entry", + sizeof(struct vm_map_entry), 0, + NULL, 0); +#if 1 kmem_cache_init(&vm_map_kentry_cache, "vm_map_kentry", - sizeof(struct vm_map_entry), 0, NULL, kentry_pagealloc, - NULL, KMEM_CACHE_NOCPUPOOL | KMEM_CACHE_NOOFFSLAB - | KMEM_CACHE_NORECLAIM); + sizeof(struct vm_map_entry), 0, + NULL, KMEM_CACHE_NOCPUPOOL | KMEM_CACHE_NOOFFSLAB); #endif - kmem_cache_init(&vm_map_copy_cache, "vm_map_copy", - sizeof(struct vm_map_copy), 0, NULL, NULL, NULL, 0); + kmem_cache_init (&vm_map_copy_cache, + "vm_map_copy", + sizeof(struct vm_map_copy), 0, + NULL, 0); /* * Submap object is initialized by vm_object_init. |