summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-01-08 00:17:02 +0100
committerRichard Braun <rbraun@sceen.net>2013-01-08 00:17:02 +0100
commit64cd914cf46ce29d032a155bde3265ff5339cc61 (patch)
treed9c56b1c8838af896a2d84c4c3f56ab3715a2299
parentdd961d1cef715b4c1e4fedd2f43fae6703f128ba (diff)
Fix slab cache list locking
This problem was overlooked because of simple locks being no-ops. * kern/slab.c (slab_collect): Fix lock name to kmem_cache_list_lock. (host_slab_info): Likewise.
-rw-r--r--kern/slab.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kern/slab.c b/kern/slab.c
index 2923f47..99d5bca 100644
--- a/kern/slab.c
+++ b/kern/slab.c
@@ -1317,12 +1317,12 @@ void slab_collect(void)
kmem_gc_last_tick = elapsed_ticks;
- simple_lock(&mem_cache_list_lock);
+ simple_lock(&kmem_cache_list_lock);
list_for_each_entry(&kmem_cache_list, cache, node)
kmem_cache_reap(cache);
- simple_unlock(&mem_cache_list_lock);
+ simple_unlock(&kmem_cache_list_lock);
}
void slab_bootstrap(void)
@@ -1536,9 +1536,9 @@ kern_return_t host_slab_info(host_t host, cache_info_array_t *infop,
* Assume the cache list is unaltered once the kernel is ready.
*/
- simple_lock(&mem_cache_list_lock);
+ simple_lock(&kmem_cache_list_lock);
nr_caches = kmem_nr_caches;
- simple_unlock(&mem_cache_list_lock);
+ simple_unlock(&kmem_cache_list_lock);
if (nr_caches <= *infoCntp)
info = *infop;