aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/rt_domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/rt_domain.c')
-rw-r--r--litmus/rt_domain.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c
index 09123eeadf2c..5264d2546a7f 100644
--- a/litmus/rt_domain.c
+++ b/litmus/rt_domain.c
@@ -254,7 +254,7 @@ static void setup_release(rt_domain_t *_rt)
254 list_for_each_safe(pos, safe, &list) { 254 list_for_each_safe(pos, safe, &list) {
255 /* pick task of work list */ 255 /* pick task of work list */
256 t = list_entry(pos, struct task_struct, rt_param.list); 256 t = list_entry(pos, struct task_struct, rt_param.list);
257 sched_trace_task_release(t); 257 /* sched_trace_task_release(t); */
258 list_del_init(pos); 258 list_del_init(pos);
259 259
260 /* put into release heap while holding release_lock */ 260 /* put into release heap while holding release_lock */
@@ -410,14 +410,21 @@ static void pd_requeue(domain_t *dom, struct task_struct *task)
410 BUG_ON(is_queued(task)); 410 BUG_ON(is_queued(task));
411 BUG_ON(get_task_domain(task) != dom); 411 BUG_ON(get_task_domain(task) != dom);
412 412
413 if (is_queued(task)) {
414 VTRACE_TASK(task, "Queued, skipping\n");
415 return;
416 }
417
413 if (is_released(task, litmus_clock())) { 418 if (is_released(task, litmus_clock())) {
414 __add_ready(domain, task); 419 __add_ready(domain, task);
415 VTRACE("rt: adding %s/%d (%llu, %llu) rel=%llu to ready queue at %llu\n", 420 /* tsk_rt(task)->go = 1; */
421 VTRACE("going, rt: adding %s/%d (%llu, %llu) rel=%llu to ready queue at %llu\n",
416 task->comm, task->pid, get_exec_cost(task), get_rt_period(task), 422 task->comm, task->pid, get_exec_cost(task), get_rt_period(task),
417 get_release(task), litmus_clock()); 423 get_release(task), litmus_clock());
418 } else { 424 } else {
419 /* task has to wait for next release */ 425 /* task has to wait for next release */
420 VTRACE_TASK(task, "add release(), rel=%llu\n", get_release(task)); 426 VTRACE_TASK(task, "not going, add release(), rel=%llu\n", get_release(task));
427 /* tsk_rt(task)->go = 0; */
421 add_release(domain, task); 428 add_release(domain, task);
422 } 429 }
423 430
@@ -429,7 +436,12 @@ static void pd_requeue(domain_t *dom, struct task_struct *task)
429 */ 436 */
430static struct task_struct* pd_take_ready(domain_t *dom) 437static struct task_struct* pd_take_ready(domain_t *dom)
431{ 438{
432 return __take_ready((rt_domain_t*)dom->data); 439 struct task_struct *t = __take_ready((rt_domain_t*)dom->data);
440 if (t) {
441 /* TRACE_TASK(t, "going\n"); */
442 /* tsk_rt(t)->go = 1; */
443 }
444 return t;
433} 445}
434 446
435/* pd_peek_ready - returns the head of the rt_domain ready queue 447/* pd_peek_ready - returns the head of the rt_domain ready queue
@@ -438,14 +450,23 @@ static struct task_struct* pd_take_ready(domain_t *dom)
438 */ 450 */
439static struct task_struct* pd_peek_ready(domain_t *dom) 451static struct task_struct* pd_peek_ready(domain_t *dom)
440{ 452{
441 return __next_ready((rt_domain_t*)dom->data); 453 struct task_struct *t = __peek_ready((rt_domain_t*)dom->data);
454 /* if (t) { */
455 /* TRACE_TASK(t, "going\n"); */
456 /* tsk_rt(t)->go = 1; */
457 /* } */
458 return t;
442} 459}
443 460
444static void pd_remove(domain_t *dom, struct task_struct *task) 461static void pd_remove(domain_t *dom, struct task_struct *task)
445{ 462{
446 if (is_queued(task)) { 463 if (is_queued(task))
447 remove((rt_domain_t*)dom->data, task); 464 remove((rt_domain_t*)dom->data, task);
448 } 465 /* if (is_queued(task) && tsk_rt(task)->go) { */
466 /* remove((rt_domain_t*)dom->data, task); */
467 /* } else if (is_queued(task)) { */
468 /* VTRACE_TASK(task, "Did not remove cause of nogo\n"); */
469 /* } */
449} 470}
450 471
451/* pd_domain_init - create a generic domain wrapper for an rt_domain 472/* pd_domain_init - create a generic domain wrapper for an rt_domain