aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/litmus.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2009-12-21 12:23:57 -0500
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-29 17:20:00 -0400
commitee09f78d8faa0b988088d93142e6f5f8a6e75394 (patch)
treebc1e0b5db121be3de47d967973310d610ad943a2 /litmus/litmus.c
parent0b28a3122d6917784701377e15a863489aee1c6c (diff)
Refactor binomial heap names: heap -> bheap
- Binomial heap "heap" names conflicted with priority heap of cgroup in kernel - This patch change binomial heap "heap" names in "bheap"
Diffstat (limited to 'litmus/litmus.c')
-rw-r--r--litmus/litmus.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c
index de751a14d77c..2dea340aea1d 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -15,7 +15,7 @@
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <litmus/sched_plugin.h> 16#include <litmus/sched_plugin.h>
17 17
18#include <litmus/heap.h> 18#include <litmus/bheap.h>
19 19
20#include <litmus/trace.h> 20#include <litmus/trace.h>
21 21
@@ -31,17 +31,17 @@ atomic_t __log_seq_no = ATOMIC_INIT(0);
31/* current master CPU for handling timer IRQs */ 31/* current master CPU for handling timer IRQs */
32atomic_t release_master_cpu = ATOMIC_INIT(NO_CPU); 32atomic_t release_master_cpu = ATOMIC_INIT(NO_CPU);
33 33
34static struct kmem_cache * heap_node_cache; 34static struct kmem_cache * bheap_node_cache;
35extern struct kmem_cache * release_heap_cache; 35extern struct kmem_cache * release_heap_cache;
36 36
37struct heap_node* heap_node_alloc(int gfp_flags) 37struct bheap_node* bheap_node_alloc(int gfp_flags)
38{ 38{
39 return kmem_cache_alloc(heap_node_cache, gfp_flags); 39 return kmem_cache_alloc(bheap_node_cache, gfp_flags);
40} 40}
41 41
42void heap_node_free(struct heap_node* hn) 42void bheap_node_free(struct bheap_node* hn)
43{ 43{
44 kmem_cache_free(heap_node_cache, hn); 44 kmem_cache_free(bheap_node_cache, hn);
45} 45}
46 46
47struct release_heap* release_heap_alloc(int gfp_flags); 47struct release_heap* release_heap_alloc(int gfp_flags);
@@ -323,19 +323,19 @@ long litmus_admit_task(struct task_struct* tsk)
323 spin_lock_irqsave(&task_transition_lock, flags); 323 spin_lock_irqsave(&task_transition_lock, flags);
324 324
325 /* allocate heap node for this task */ 325 /* allocate heap node for this task */
326 tsk_rt(tsk)->heap_node = heap_node_alloc(GFP_ATOMIC); 326 tsk_rt(tsk)->heap_node = bheap_node_alloc(GFP_ATOMIC);
327 tsk_rt(tsk)->rel_heap = release_heap_alloc(GFP_ATOMIC); 327 tsk_rt(tsk)->rel_heap = release_heap_alloc(GFP_ATOMIC);
328 328
329 if (!tsk_rt(tsk)->heap_node || !tsk_rt(tsk)->rel_heap) { 329 if (!tsk_rt(tsk)->heap_node || !tsk_rt(tsk)->rel_heap) {
330 printk(KERN_WARNING "litmus: no more heap node memory!?\n"); 330 printk(KERN_WARNING "litmus: no more heap node memory!?\n");
331 331
332 heap_node_free(tsk_rt(tsk)->heap_node); 332 bheap_node_free(tsk_rt(tsk)->heap_node);
333 release_heap_free(tsk_rt(tsk)->rel_heap); 333 release_heap_free(tsk_rt(tsk)->rel_heap);
334 334
335 retval = -ENOMEM; 335 retval = -ENOMEM;
336 goto out_unlock; 336 goto out_unlock;
337 } else { 337 } else {
338 heap_node_init(&tsk_rt(tsk)->heap_node, tsk); 338 bheap_node_init(&tsk_rt(tsk)->heap_node, tsk);
339 } 339 }
340 340
341 retval = litmus->admit_task(tsk); 341 retval = litmus->admit_task(tsk);
@@ -359,8 +359,8 @@ void litmus_exit_task(struct task_struct* tsk)
359 359
360 litmus->task_exit(tsk); 360 litmus->task_exit(tsk);
361 361
362 BUG_ON(heap_node_in_heap(tsk_rt(tsk)->heap_node)); 362 BUG_ON(bheap_node_in_heap(tsk_rt(tsk)->heap_node));
363 heap_node_free(tsk_rt(tsk)->heap_node); 363 bheap_node_free(tsk_rt(tsk)->heap_node);
364 release_heap_free(tsk_rt(tsk)->rel_heap); 364 release_heap_free(tsk_rt(tsk)->rel_heap);
365 365
366 atomic_dec(&rt_task_count); 366 atomic_dec(&rt_task_count);
@@ -648,7 +648,7 @@ static int __init _init_litmus(void)
648 648
649 register_sched_plugin(&linux_sched_plugin); 649 register_sched_plugin(&linux_sched_plugin);
650 650
651 heap_node_cache = KMEM_CACHE(heap_node, SLAB_PANIC); 651 bheap_node_cache = KMEM_CACHE(bheap_node, SLAB_PANIC);
652 release_heap_cache = KMEM_CACHE(release_heap, SLAB_PANIC); 652 release_heap_cache = KMEM_CACHE(release_heap, SLAB_PANIC);
653 653
654#ifdef CONFIG_MAGIC_SYSRQ 654#ifdef CONFIG_MAGIC_SYSRQ
@@ -667,7 +667,7 @@ static int __init _init_litmus(void)
667static void _exit_litmus(void) 667static void _exit_litmus(void)
668{ 668{
669 exit_litmus_proc(); 669 exit_litmus_proc();
670 kmem_cache_destroy(heap_node_cache); 670 kmem_cache_destroy(bheap_node_cache);
671 kmem_cache_destroy(release_heap_cache); 671 kmem_cache_destroy(release_heap_cache);
672} 672}
673 673