aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-01-27 23:46:48 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2013-01-27 23:46:48 -0500
commitcc6a4b90595a566fbd9fcaf8a9399e35f0a7ef93 (patch)
treecb599881bf4d699c457a1a5f5b42f0770071d6cb
parente2231dd23a0a8568d7a7bdc5ac0771bf270010f0 (diff)
ECRTS13 testbed (hopefully)
fixed minor bugs and cleaned up ikglp affinity logic
-rw-r--r--include/litmus/rt_domain.h2
-rw-r--r--litmus/ikglp_lock.c40
-rw-r--r--litmus/litmus.c7
-rw-r--r--litmus/sched_cedf.c3
-rw-r--r--litmus/sched_task_trace.c4
5 files changed, 24 insertions, 32 deletions
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h
index 961d7e7c4912..89a8850ecf9d 100644
--- a/include/litmus/rt_domain.h
+++ b/include/litmus/rt_domain.h
@@ -95,7 +95,7 @@ static inline struct task_struct* __take_ready(rt_domain_t* rt)
95 (taken && tsk_rt(taken)->inh_task) ? 95 (taken && tsk_rt(taken)->inh_task) ?
96 tsk_rt(taken)->inh_task->pid : -1); 96 tsk_rt(taken)->inh_task->pid : -1);
97 97
98 return bheap2task(hn); 98 return taken;
99 } 99 }
100 else 100 else
101 return NULL; 101 return NULL;
diff --git a/litmus/ikglp_lock.c b/litmus/ikglp_lock.c
index ae769bce58d6..e78a4ec0dff6 100644
--- a/litmus/ikglp_lock.c
+++ b/litmus/ikglp_lock.c
@@ -476,7 +476,7 @@ static void ikglp_refresh_owners_prio_decrease(struct fifo_queue *fq,
476 old_max_eff_prio = top_priority(&tsk_rt(owner)->hp_blocked_tasks); 476 old_max_eff_prio = top_priority(&tsk_rt(owner)->hp_blocked_tasks);
477 477
478 binheap_delete(&fq->nest.hp_binheap_node, &tsk_rt(owner)->hp_blocked_tasks); 478 binheap_delete(&fq->nest.hp_binheap_node, &tsk_rt(owner)->hp_blocked_tasks);
479 fq->nest.hp_waiter_eff_prio = effective_priority(fq->hp_waiter); 479 fq->nest.hp_waiter_eff_prio = (fq->hp_waiter) ? effective_priority(fq->hp_waiter) : NULL;
480 binheap_add(&fq->nest.hp_binheap_node, &tsk_rt(owner)->hp_blocked_tasks, 480 binheap_add(&fq->nest.hp_binheap_node, &tsk_rt(owner)->hp_blocked_tasks,
481 struct nested_info, hp_binheap_node); 481 struct nested_info, hp_binheap_node);
482 482
@@ -1373,16 +1373,12 @@ int ikglp_unlock(struct litmus_lock* l)
1373 donee = t; 1373 donee = t;
1374 1374
1375#ifdef CONFIG_LITMUS_AFFINITY_LOCKING 1375#ifdef CONFIG_LITMUS_AFFINITY_LOCKING
1376 if(sem->aff_obs && sem->aff_obs->relax_max_fifo_len) { 1376 if(sem->aff_obs)
1377 fq_of_new_on_fq = sem->aff_obs->ops->advise_enqueue(sem->aff_obs, new_on_fq); 1377 fq_of_new_on_fq = sem->aff_obs->ops->advise_enqueue(sem->aff_obs, new_on_fq);
1378 if(fq_of_new_on_fq->count == 0) { 1378 if((fq_of_new_on_fq->count >= sem->max_fifo_len) && !sem->aff_obs->relax_max_fifo_len)
1379 // ignore it? 1379 fq_of_new_on_fq = fq; /* discard recommendation */
1380// fq_of_new_on_fq = fq; 1380 else
1381 }
1382 }
1383 else {
1384 fq_of_new_on_fq = fq; 1381 fq_of_new_on_fq = fq;
1385 }
1386#else 1382#else
1387 fq_of_new_on_fq = fq; 1383 fq_of_new_on_fq = fq;
1388#endif 1384#endif
@@ -1413,16 +1409,12 @@ int ikglp_unlock(struct litmus_lock* l)
1413 binheap_decrease(&other_donor_info->donee_info->node, &sem->donees); 1409 binheap_decrease(&other_donor_info->donee_info->node, &sem->donees);
1414 1410
1415#ifdef CONFIG_LITMUS_AFFINITY_LOCKING 1411#ifdef CONFIG_LITMUS_AFFINITY_LOCKING
1416 if(sem->aff_obs && sem->aff_obs->relax_max_fifo_len) { 1412 if(sem->aff_obs)
1417 fq_of_new_on_fq = sem->aff_obs->ops->advise_enqueue(sem->aff_obs, new_on_fq); 1413 fq_of_new_on_fq = sem->aff_obs->ops->advise_enqueue(sem->aff_obs, new_on_fq);
1418 if(fq_of_new_on_fq->count == 0) { 1414 if((fq_of_new_on_fq->count >= sem->max_fifo_len) && !sem->aff_obs->relax_max_fifo_len)
1419 // ignore it? 1415 fq_of_new_on_fq = fq; /* discard recommendation */
1420// fq_of_new_on_fq = fq; 1416 else
1421 }
1422 }
1423 else {
1424 fq_of_new_on_fq = fq; 1417 fq_of_new_on_fq = fq;
1425 }
1426#else 1418#else
1427 fq_of_new_on_fq = fq; 1419 fq_of_new_on_fq = fq;
1428#endif 1420#endif
@@ -1444,16 +1436,12 @@ int ikglp_unlock(struct litmus_lock* l)
1444 new_on_fq = pq_wait->task; 1436 new_on_fq = pq_wait->task;
1445 1437
1446#ifdef CONFIG_LITMUS_AFFINITY_LOCKING 1438#ifdef CONFIG_LITMUS_AFFINITY_LOCKING
1447 if(sem->aff_obs && sem->aff_obs->relax_max_fifo_len) { 1439 if(sem->aff_obs)
1448 fq_of_new_on_fq = sem->aff_obs->ops->advise_enqueue(sem->aff_obs, new_on_fq); 1440 fq_of_new_on_fq = sem->aff_obs->ops->advise_enqueue(sem->aff_obs, new_on_fq);
1449 if(fq_of_new_on_fq->count == 0) { 1441 if((fq_of_new_on_fq->count >= sem->max_fifo_len) && !sem->aff_obs->relax_max_fifo_len)
1450 // ignore it? 1442 fq_of_new_on_fq = fq; /* discard recommendation */
1451// fq_of_new_on_fq = fq; 1443 else
1452 }
1453 }
1454 else {
1455 fq_of_new_on_fq = fq; 1444 fq_of_new_on_fq = fq;
1456 }
1457#else 1445#else
1458 fq_of_new_on_fq = fq; 1446 fq_of_new_on_fq = fq;
1459#endif 1447#endif
@@ -1507,8 +1495,8 @@ int ikglp_unlock(struct litmus_lock* l)
1507 // This kills any inheritance from a donor. 1495 // This kills any inheritance from a donor.
1508 raw_spin_lock(&tsk_rt(t)->hp_blocked_tasks_lock); 1496 raw_spin_lock(&tsk_rt(t)->hp_blocked_tasks_lock);
1509 { 1497 {
1510 TRACE_TASK(t, "discarding _all_ inheritance because IKGLP is outermost\n");
1511 int count = 0; 1498 int count = 0;
1499 TRACE_TASK(t, "discarding _all_ inheritance because IKGLP is outermost\n");
1512 while(!binheap_empty(&tsk_rt(t)->hp_blocked_tasks)) { 1500 while(!binheap_empty(&tsk_rt(t)->hp_blocked_tasks)) {
1513 binheap_delete_root(&tsk_rt(t)->hp_blocked_tasks, 1501 binheap_delete_root(&tsk_rt(t)->hp_blocked_tasks,
1514 struct nested_info, hp_binheap_node); 1502 struct nested_info, hp_binheap_node);
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 35bc70455425..f0d01c34110c 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -351,7 +351,7 @@ asmlinkage long sys_sched_trace_event(int event, struct st_inject_args __user *_
351 } 351 }
352 352
353 /* slam in the data */ 353 /* slam in the data */
354 t->rt_param.job_params.job_no = args.job_no; 354 tsk_rt(t)->job_params.job_no = args.job_no;
355 355
356 sched_trace_task_completion(t, 0); 356 sched_trace_task_completion(t, 0);
357 break; 357 break;
@@ -362,8 +362,9 @@ asmlinkage long sys_sched_trace_event(int event, struct st_inject_args __user *_
362 } 362 }
363 363
364 /* slam in the data */ 364 /* slam in the data */
365 tsk_rt(t)->job_params.release = args.release; 365 get_release(t) = args.release;
366 tsk_rt(t)->job_params.deadline = args.deadline; 366 get_deadline(t) = args.deadline;
367 tsk_rt(t)->job_params.job_no = args.job_no;
367 368
368 sched_trace_task_release(t); 369 sched_trace_task_release(t);
369 break; 370 break;
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c
index 0d8773b2495f..9d4e822aeede 100644
--- a/litmus/sched_cedf.c
+++ b/litmus/sched_cedf.c
@@ -418,6 +418,8 @@ static noinline void job_completion(struct task_struct *t, int forced)
418 TRACE_TASK(t, "job_completion() at %llu.\n", litmus_clock()); 418 TRACE_TASK(t, "job_completion() at %llu.\n", litmus_clock());
419 419
420#ifdef CONFIG_LITMUS_LOCKING 420#ifdef CONFIG_LITMUS_LOCKING
421 BUG_ON(!is_persistent(t) && tsk_rt(t)->inh_task);
422#if 0
421 if (!is_persistent(t) && tsk_rt(t)->inh_task) { 423 if (!is_persistent(t) && tsk_rt(t)->inh_task) {
422 /* job completing while inheriting a priority */ 424 /* job completing while inheriting a priority */
423 TRACE_TASK(t, 425 TRACE_TASK(t,
@@ -427,6 +429,7 @@ static noinline void job_completion(struct task_struct *t, int forced)
427 tsk_rt(t)->inh_task->pid); 429 tsk_rt(t)->inh_task->pid);
428 } 430 }
429#endif 431#endif
432#endif
430 433
431 /* set flags */ 434 /* set flags */
432 tsk_rt(t)->completed = 1; 435 tsk_rt(t)->completed = 1;
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c
index 1693d70d0911..2583ee2bb437 100644
--- a/litmus/sched_task_trace.c
+++ b/litmus/sched_task_trace.c
@@ -155,7 +155,7 @@ feather_callback void do_sched_trace_task_switch_to(unsigned long id,
155{ 155{
156 struct task_struct *t = (struct task_struct*) _task; 156 struct task_struct *t = (struct task_struct*) _task;
157 struct st_event_record* rec; 157 struct st_event_record* rec;
158 //if (is_realtime(t)) /* comment out to trace EVERYTHING */ 158 if (is_realtime(t)) /* comment out to trace EVERYTHING */
159 { 159 {
160 rec = get_record(ST_SWITCH_TO, t); 160 rec = get_record(ST_SWITCH_TO, t);
161 if (rec) { 161 if (rec) {
@@ -171,7 +171,7 @@ feather_callback void do_sched_trace_task_switch_away(unsigned long id,
171{ 171{
172 struct task_struct *t = (struct task_struct*) _task; 172 struct task_struct *t = (struct task_struct*) _task;
173 struct st_event_record* rec; 173 struct st_event_record* rec;
174 //if (is_realtime(t)) /* comment out to trace EVERYTHING */ 174 if (is_realtime(t)) /* comment out to trace EVERYTHING */
175 { 175 {
176 rec = get_record(ST_SWITCH_AWAY, t); 176 rec = get_record(ST_SWITCH_AWAY, t);
177 if (rec) { 177 if (rec) {