aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/rt_domain.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/rt_domain.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/rt_domain.c')
-rw-r--r--litmus/rt_domain.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c
index 62c9fdcd22be..0ed6d5cbbfc5 100644
--- a/litmus/rt_domain.c
+++ b/litmus/rt_domain.c
@@ -19,20 +19,20 @@
19 19
20#include <litmus/trace.h> 20#include <litmus/trace.h>
21 21
22#include <litmus/heap.h> 22#include <litmus/bheap.h>
23 23
24static int dummy_resched(rt_domain_t *rt) 24static int dummy_resched(rt_domain_t *rt)
25{ 25{
26 return 0; 26 return 0;
27} 27}
28 28
29static int dummy_order(struct heap_node* a, struct heap_node* b) 29static int dummy_order(struct bheap_node* a, struct bheap_node* b)
30{ 30{
31 return 0; 31 return 0;
32} 32}
33 33
34/* default implementation: use default lock */ 34/* default implementation: use default lock */
35static void default_release_jobs(rt_domain_t* rt, struct heap* tasks) 35static void default_release_jobs(rt_domain_t* rt, struct bheap* tasks)
36{ 36{
37 merge_ready(rt, tasks); 37 merge_ready(rt, tasks);
38} 38}
@@ -157,7 +157,7 @@ static void reinit_release_heap(struct task_struct* t)
157 BUG_ON(hrtimer_cancel(&rh->timer)); 157 BUG_ON(hrtimer_cancel(&rh->timer));
158 158
159 /* initialize */ 159 /* initialize */
160 heap_init(&rh->heap); 160 bheap_init(&rh->heap);
161 atomic_set(&rh->info.state, HRTIMER_START_ON_INACTIVE); 161 atomic_set(&rh->info.state, HRTIMER_START_ON_INACTIVE);
162} 162}
163/* arm_release_timer() - start local release timer or trigger 163/* arm_release_timer() - start local release timer or trigger
@@ -204,7 +204,7 @@ static void arm_release_timer(rt_domain_t *_rt)
204 204
205 rh = get_release_heap(rt, t, 1); 205 rh = get_release_heap(rt, t, 1);
206 } 206 }
207 heap_insert(rt->order, &rh->heap, tsk_rt(t)->heap_node); 207 bheap_insert(rt->order, &rh->heap, tsk_rt(t)->heap_node);
208 TRACE_TASK(t, "arm_release_timer(): added to release heap\n"); 208 TRACE_TASK(t, "arm_release_timer(): added to release heap\n");
209 209
210 spin_unlock(&rt->release_lock); 210 spin_unlock(&rt->release_lock);
@@ -236,7 +236,7 @@ static void arm_release_timer(rt_domain_t *_rt)
236} 236}
237 237
238void rt_domain_init(rt_domain_t *rt, 238void rt_domain_init(rt_domain_t *rt,
239 heap_prio_t order, 239 bheap_prio_t order,
240 check_resched_needed_t check, 240 check_resched_needed_t check,
241 release_jobs_t release 241 release_jobs_t release
242 ) 242 )
@@ -253,7 +253,7 @@ void rt_domain_init(rt_domain_t *rt,
253 253
254 rt->release_master = NO_CPU; 254 rt->release_master = NO_CPU;
255 255
256 heap_init(&rt->ready_queue); 256 bheap_init(&rt->ready_queue);
257 INIT_LIST_HEAD(&rt->tobe_released); 257 INIT_LIST_HEAD(&rt->tobe_released);
258 for (i = 0; i < RELEASE_QUEUE_SLOTS; i++) 258 for (i = 0; i < RELEASE_QUEUE_SLOTS; i++)
259 INIT_LIST_HEAD(&rt->release_queue.slot[i]); 259 INIT_LIST_HEAD(&rt->release_queue.slot[i]);
@@ -276,18 +276,18 @@ void __add_ready(rt_domain_t* rt, struct task_struct *new)
276 new->comm, new->pid, get_exec_cost(new), get_rt_period(new), 276 new->comm, new->pid, get_exec_cost(new), get_rt_period(new),
277 get_release(new), litmus_clock()); 277 get_release(new), litmus_clock());
278 278
279 BUG_ON(heap_node_in_heap(tsk_rt(new)->heap_node)); 279 BUG_ON(bheap_node_in_heap(tsk_rt(new)->heap_node));
280 280
281 heap_insert(rt->order, &rt->ready_queue, tsk_rt(new)->heap_node); 281 bheap_insert(rt->order, &rt->ready_queue, tsk_rt(new)->heap_node);
282 rt->check_resched(rt); 282 rt->check_resched(rt);
283} 283}
284 284
285/* merge_ready - Add a sorted set of tasks to the rt ready queue. They must be runnable. 285/* merge_ready - Add a sorted set of tasks to the rt ready queue. They must be runnable.
286 * @tasks - the newly released tasks 286 * @tasks - the newly released tasks
287 */ 287 */
288void __merge_ready(rt_domain_t* rt, struct heap* tasks) 288void __merge_ready(rt_domain_t* rt, struct bheap* tasks)
289{ 289{
290 heap_union(rt->order, &rt->ready_queue, tasks); 290 bheap_union(rt->order, &rt->ready_queue, tasks);
291 rt->check_resched(rt); 291 rt->check_resched(rt);
292} 292}
293 293