diff options
author | Richard Braun <rbraun@sceen.net> | 2016-02-22 21:59:07 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2016-02-22 21:59:07 +0100 |
commit | 724326b4d590d94ff81eb2e5817cc79a9bade7e4 (patch) | |
tree | 0536d17f1a5db9625a0a6561d91157e958942e7d /vm | |
parent | b325f426b367d813b23799aeb058d7d3ac81f13d (diff) | |
download | gnumach-724326b4d590d94ff81eb2e5817cc79a9bade7e4.tar.gz gnumach-724326b4d590d94ff81eb2e5817cc79a9bade7e4.tar.bz2 gnumach-724326b4d590d94ff81eb2e5817cc79a9bade7e4.zip |
Fix slab allocator option handling
The slab allocator has grown to use multiple ways to allocate slabs
as well as track them, which got a little messy. One consequence is
the breaking of the KMEM_CF_VERIFY option. In order to make the code
less confusing, this change expresses all options as explicit cache
flags and clearly defines their relationships.
The special kmem_slab and vm_map_entry caches are initialized
accordingly.
* kern/slab.c (KMEM_CF_DIRECTMAP): Rename to ...
(KMEM_CF_PHYSMEM): ... this new macro.
(KMEM_CF_DIRECT): Restore macro.
(KMEM_CF_USE_TREE, KMEM_CF_USE_PAGE): New macros.
(KMEM_CF_VERIFY): Update value.
(kmem_pagealloc_directmap): Rename to...
(kmem_pagealloc_physmem): ... this new function.
(kmem_pagefree_directmap): Rename to ...
(kmem_pagefree_physmem): ... this new function.
(kmem_pagealloc, kmem_pagefree): Update macro names.
(kmem_slab_use_tree): Remove function.
(kmem_slab_create, kmem_slab_destroy): Update according to the new
cache flags.
(kmem_cache_compute_sizes): Rename to ...
(kmem_cache_compute_properties): ... this new function, and update
to properly set cache flags.
(kmem_cache_init): Update call to kmem_cache_compute_properties.
(kmem_cache_alloc_from_slab): Check KMEM_CF_USE_TREE instead of
calling the defunct kmem_slab_use_tree function.
(kmem_cache_free_to_slab): Update according to the new cache flags.
kmem_cache_free_verify): Add assertion.
(slab_init): Update initialization of kmem_slab_cache.
* kern/slab.h (KMEM_CACHE_DIRECTMAP): Rename to ...
(KMEM_CACHE_PHYSMEM): ... this new macro.
* vm/vm_map.c (vm_map_init): Update initialization of vm_map_entry_cache.
Diffstat (limited to 'vm')
-rw-r--r-- | vm/vm_map.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c index 6c0232e4..89a2b382 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -161,7 +161,7 @@ void vm_map_init(void) NULL, 0); kmem_cache_init(&vm_map_entry_cache, "vm_map_entry", sizeof(struct vm_map_entry), 0, NULL, - KMEM_CACHE_DIRECTMAP); + KMEM_CACHE_NOOFFSLAB | KMEM_CACHE_PHYSMEM); kmem_cache_init(&vm_map_copy_cache, "vm_map_copy", sizeof(struct vm_map_copy), 0, NULL, 0); |