aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-11-11 13:11:25 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-11-11 13:11:25 -0500
commit7ebec2a6abe03d5c42742a6dce74787880394897 (patch)
treea1e7277cae212c20c0190e1c93b1b10c5fb9a460
parentdede6a6b8ce09f48295d8ba4635480c98ef85284 (diff)
parent5dbf603e3ca76a3903b83aacc6bb19e6aa0d924a (diff)
Merge branch 'wip-aux-hacks' into wip-load-balance-gpus
-rw-r--r--litmus/aux_tasks.c26
-rw-r--r--litmus/edf_common.c24
-rw-r--r--litmus/litmus.c4
-rw-r--r--litmus/locking.c4
4 files changed, 51 insertions, 7 deletions
diff --git a/litmus/aux_tasks.c b/litmus/aux_tasks.c
index efda7dc0bd76..9572d960b46a 100644
--- a/litmus/aux_tasks.c
+++ b/litmus/aux_tasks.c
@@ -50,6 +50,7 @@ int exit_aux_task(struct task_struct *t)
50 50
51 TRACE_CUR("Aux task %s/%d is exiting from %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid); 51 TRACE_CUR("Aux task %s/%d is exiting from %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid);
52 52
53#if 0
53 list_del(&tsk_rt(t)->aux_task_node); 54 list_del(&tsk_rt(t)->aux_task_node);
54 55
55 tsk_rt(t)->is_aux_task = 0; 56 tsk_rt(t)->is_aux_task = 0;
@@ -57,6 +58,7 @@ int exit_aux_task(struct task_struct *t)
57 if (tsk_rt(t)->inh_task) { 58 if (tsk_rt(t)->inh_task) {
58 litmus->__decrease_prio(t, NULL); 59 litmus->__decrease_prio(t, NULL);
59 } 60 }
61#endif
60 62
61 return retval; 63 return retval;
62} 64}
@@ -64,6 +66,8 @@ int exit_aux_task(struct task_struct *t)
64static int aux_tasks_increase_priority(struct task_struct *leader, struct task_struct *hp) 66static int aux_tasks_increase_priority(struct task_struct *leader, struct task_struct *hp)
65{ 67{
66 int retval = 0; 68 int retval = 0;
69
70#if 0
67 struct list_head *pos; 71 struct list_head *pos;
68 72
69 TRACE_CUR("Increasing priority of aux tasks in group %s/%d.\n", leader->comm, leader->pid); 73 TRACE_CUR("Increasing priority of aux tasks in group %s/%d.\n", leader->comm, leader->pid);
@@ -81,6 +85,7 @@ static int aux_tasks_increase_priority(struct task_struct *leader, struct task_s
81 TRACE_CUR("increasing %s/%d.\n", aux->comm, aux->pid); 85 TRACE_CUR("increasing %s/%d.\n", aux->comm, aux->pid);
82 retval = litmus->__increase_prio(aux, hp); 86 retval = litmus->__increase_prio(aux, hp);
83 } 87 }
88#endif
84 89
85 return retval; 90 return retval;
86} 91}
@@ -88,6 +93,8 @@ static int aux_tasks_increase_priority(struct task_struct *leader, struct task_s
88static int aux_tasks_decrease_priority(struct task_struct *leader, struct task_struct *hp) 93static int aux_tasks_decrease_priority(struct task_struct *leader, struct task_struct *hp)
89{ 94{
90 int retval = 0; 95 int retval = 0;
96
97#if 0
91 struct list_head *pos; 98 struct list_head *pos;
92 99
93 TRACE_CUR("Decreasing priority of aux tasks in group %s/%d.\n", leader->comm, leader->pid); 100 TRACE_CUR("Decreasing priority of aux tasks in group %s/%d.\n", leader->comm, leader->pid);
@@ -105,6 +112,7 @@ static int aux_tasks_decrease_priority(struct task_struct *leader, struct task_s
105 retval = litmus->__decrease_prio(aux, hp); 112 retval = litmus->__decrease_prio(aux, hp);
106 } 113 }
107 } 114 }
115#endif
108 116
109 return retval; 117 return retval;
110} 118}
@@ -112,6 +120,8 @@ static int aux_tasks_decrease_priority(struct task_struct *leader, struct task_s
112int aux_task_owner_increase_priority(struct task_struct *t) 120int aux_task_owner_increase_priority(struct task_struct *t)
113{ 121{
114 int retval = 0; 122 int retval = 0;
123
124#if 0
115 struct task_struct *leader; 125 struct task_struct *leader;
116 struct task_struct *hp = NULL; 126 struct task_struct *hp = NULL;
117 struct task_struct *hp_eff = NULL; 127 struct task_struct *hp_eff = NULL;
@@ -146,6 +156,7 @@ int aux_task_owner_increase_priority(struct task_struct *t)
146 TRACE_CUR("%s/%d is new hp in group %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid); 156 TRACE_CUR("%s/%d is new hp in group %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid);
147 retval = aux_tasks_increase_priority(leader, hp_eff); 157 retval = aux_tasks_increase_priority(leader, hp_eff);
148 } 158 }
159#endif
149 160
150out: 161out:
151 return retval; 162 return retval;
@@ -154,6 +165,8 @@ out:
154int aux_task_owner_decrease_priority(struct task_struct *t) 165int aux_task_owner_decrease_priority(struct task_struct *t)
155{ 166{
156 int retval = 0; 167 int retval = 0;
168
169#if 0
157 struct task_struct *leader; 170 struct task_struct *leader;
158 struct task_struct *hp = NULL; 171 struct task_struct *hp = NULL;
159 struct task_struct *hp_eff = NULL; 172 struct task_struct *hp_eff = NULL;
@@ -189,6 +202,7 @@ int aux_task_owner_decrease_priority(struct task_struct *t)
189 retval = aux_tasks_decrease_priority(leader, hp_eff); 202 retval = aux_tasks_decrease_priority(leader, hp_eff);
190 } 203 }
191 } 204 }
205#endif
192 206
193out: 207out:
194 return retval; 208 return retval;
@@ -199,6 +213,8 @@ out:
199long enable_aux_task_owner(struct task_struct *t) 213long enable_aux_task_owner(struct task_struct *t)
200{ 214{
201 long retval = 0; 215 long retval = 0;
216
217#if 0
202 struct task_struct *leader = t->group_leader; 218 struct task_struct *leader = t->group_leader;
203 struct task_struct *hp; 219 struct task_struct *hp;
204 220
@@ -226,7 +242,7 @@ long enable_aux_task_owner(struct task_struct *t)
226 retval = aux_tasks_increase_priority(leader, 242 retval = aux_tasks_increase_priority(leader,
227 (tsk_rt(hp)->inh_task)? tsk_rt(hp)->inh_task : hp); 243 (tsk_rt(hp)->inh_task)? tsk_rt(hp)->inh_task : hp);
228 } 244 }
229 245#endif
230 246
231out: 247out:
232 return retval; 248 return retval;
@@ -235,6 +251,8 @@ out:
235long disable_aux_task_owner(struct task_struct *t) 251long disable_aux_task_owner(struct task_struct *t)
236{ 252{
237 long retval = 0; 253 long retval = 0;
254
255#if 0
238 struct task_struct *leader = t->group_leader; 256 struct task_struct *leader = t->group_leader;
239 struct task_struct *hp; 257 struct task_struct *hp;
240 struct task_struct *new_hp = NULL; 258 struct task_struct *new_hp = NULL;
@@ -273,6 +291,7 @@ long disable_aux_task_owner(struct task_struct *t)
273 291
274 retval = aux_tasks_decrease_priority(leader, to_inh); 292 retval = aux_tasks_decrease_priority(leader, to_inh);
275 } 293 }
294#endif
276 295
277out: 296out:
278 return retval; 297 return retval;
@@ -324,7 +343,10 @@ static long __do_enable_aux_tasks(void)
324 TRACE_CUR("AUX task in %s/%d: %s/%d:\n", leader->comm, leader->pid, t->comm, t->pid); 343 TRACE_CUR("AUX task in %s/%d: %s/%d:\n", leader->comm, leader->pid, t->comm, t->pid);
325 /* hasn't been aux_tasks_increase_priorityted into rt. make it a aux. */ 344 /* hasn't been aux_tasks_increase_priorityted into rt. make it a aux. */
326 tsk_rt(t)->is_aux_task = 1; 345 tsk_rt(t)->is_aux_task = 1;
346
347#if 0
327 list_add_tail(&tsk_rt(t)->aux_task_node, &tsk_aux(leader)->aux_tasks); 348 list_add_tail(&tsk_rt(t)->aux_task_node, &tsk_aux(leader)->aux_tasks);
349#endif
328 350
329 (void)admit_aux_task(t); 351 (void)admit_aux_task(t);
330 } 352 }
@@ -346,6 +368,7 @@ static long __do_enable_aux_tasks(void)
346 } while(t != leader); 368 } while(t != leader);
347 369
348 370
371#if 0
349 if (!binheap_empty(&tsk_aux(leader)->aux_task_owners)) { 372 if (!binheap_empty(&tsk_aux(leader)->aux_task_owners)) {
350 struct task_struct *hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), 373 struct task_struct *hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node),
351 struct task_struct, rt_param); 374 struct task_struct, rt_param);
@@ -353,6 +376,7 @@ static long __do_enable_aux_tasks(void)
353 retval = aux_tasks_increase_priority(leader, 376 retval = aux_tasks_increase_priority(leader,
354 (tsk_rt(hp)->inh_task)? tsk_rt(hp)->inh_task : hp); 377 (tsk_rt(hp)->inh_task)? tsk_rt(hp)->inh_task : hp);
355 } 378 }
379#endif
356 380
357 return retval; 381 return retval;
358} 382}
diff --git a/litmus/edf_common.c b/litmus/edf_common.c
index f4881452373d..916b1b4309b7 100644
--- a/litmus/edf_common.c
+++ b/litmus/edf_common.c
@@ -92,10 +92,20 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second)
92 92
93#ifdef CONFIG_REALTIME_AUX_TASKS 93#ifdef CONFIG_REALTIME_AUX_TASKS
94 { 94 {
95 /* statically prioritize all auxillary tasks that have no inheritance
96 * below all other regular real-time tasks.
97 */
98 95
96 /* run aux tasks at max priority */
97 if (first->rt_param.is_aux_task != second->rt_param.is_aux_task)
98 {
99 return (first->rt_param.is_aux_task > second->rt_param.is_aux_task);
100 }
101 else if(first->rt_param.is_aux_task && second->rt_param.is_aux_task)
102 {
103 first = first->group_leader;
104 second = second->group_leader;
105 }
106
107
108#if 0
99 int first_lo_aux, second_lo_aux; 109 int first_lo_aux, second_lo_aux;
100 int first_hi_aux, second_hi_aux; 110 int first_hi_aux, second_hi_aux;
101 first_lo_aux = first->rt_param.is_aux_task && !first->rt_param.inh_task; 111 first_lo_aux = first->rt_param.is_aux_task && !first->rt_param.inh_task;
@@ -123,6 +133,8 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second)
123 TRACE_CUR("hi aux tie break: %s/%d >> %s/%d --- %d\n", first->comm, first->pid, second->comm, second->pid, aux_hi_tie_break); 133 TRACE_CUR("hi aux tie break: %s/%d >> %s/%d --- %d\n", first->comm, first->pid, second->comm, second->pid, aux_hi_tie_break);
124 return aux_hi_tie_break; 134 return aux_hi_tie_break;
125 } 135 }
136#endif
137
126 } 138 }
127#endif 139#endif
128 140
@@ -240,6 +252,7 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second)
240 else if (first_task->rt_param.is_proxy_thread == second_task->rt_param.is_proxy_thread) { 252 else if (first_task->rt_param.is_proxy_thread == second_task->rt_param.is_proxy_thread) {
241#endif 253#endif
242 254
255#if 0
243#ifdef CONFIG_REALTIME_AUX_TASKS 256#ifdef CONFIG_REALTIME_AUX_TASKS
244 /* is this dead code? */ 257 /* is this dead code? */
245 if (tsk_rt(first)->is_aux_task < tsk_rt(second)->is_aux_task) { 258 if (tsk_rt(first)->is_aux_task < tsk_rt(second)->is_aux_task) {
@@ -247,6 +260,7 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second)
247 } 260 }
248 else if (tsk_rt(first)->is_aux_task == tsk_rt(second)->is_aux_task) { 261 else if (tsk_rt(first)->is_aux_task == tsk_rt(second)->is_aux_task) {
249#endif 262#endif
263#endif
250 264
251 /* Something could be wrong if you get this far. */ 265 /* Something could be wrong if you get this far. */
252 if (unlikely(first->rt_param.inh_task == 266 if (unlikely(first->rt_param.inh_task ==
@@ -283,10 +297,12 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second)
283 return 1; 297 return 1;
284 } 298 }
285 } 299 }
286 300#if 0
287#ifdef CONFIG_REALTIME_AUX_TASKS 301#ifdef CONFIG_REALTIME_AUX_TASKS
288 } 302 }
289#endif 303#endif
304#endif
305
290#ifdef CONFIG_LITMUS_SOFTIRQD 306#ifdef CONFIG_LITMUS_SOFTIRQD
291 } 307 }
292#endif 308#endif
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 143c746c344e..cfd14852502b 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -388,8 +388,8 @@ static void reinit_litmus_state(struct task_struct* p, int restore)
388#endif 388#endif
389 389
390#ifdef CONFIG_LITMUS_NESTED_LOCKING 390#ifdef CONFIG_LITMUS_NESTED_LOCKING
391 WARN_ON(p->rt_param.blocked_lock); 391// WARN_ON(p->rt_param.blocked_lock);
392 WARN_ON(!binheap_empty(&p->rt_param.hp_blocked_tasks)); 392// WARN_ON(!binheap_empty(&p->rt_param.hp_blocked_tasks));
393#endif 393#endif
394 394
395#ifdef CONFIG_LITMUS_SOFTIRQD 395#ifdef CONFIG_LITMUS_SOFTIRQD
diff --git a/litmus/locking.c b/litmus/locking.c
index 16c936ba8139..22f46df4308a 100644
--- a/litmus/locking.c
+++ b/litmus/locking.c
@@ -544,6 +544,7 @@ out:
544void suspend_for_lock(void) 544void suspend_for_lock(void)
545{ 545{
546#ifdef CONFIG_REALTIME_AUX_TASKS 546#ifdef CONFIG_REALTIME_AUX_TASKS
547#if 0
547 unsigned int restore = 0; 548 unsigned int restore = 0;
548 struct task_struct *t = current; 549 struct task_struct *t = current;
549 unsigned int hide; 550 unsigned int hide;
@@ -557,15 +558,18 @@ void suspend_for_lock(void)
557 tsk_rt(t)->hide_from_aux_tasks = 1; 558 tsk_rt(t)->hide_from_aux_tasks = 1;
558 } 559 }
559#endif 560#endif
561#endif
560 562
561 schedule(); 563 schedule();
562 564
563#ifdef CONFIG_REALTIME_AUX_TASKS 565#ifdef CONFIG_REALTIME_AUX_TASKS
566#if 0
564 if (restore) { 567 if (restore) {
565 /* restore our state */ 568 /* restore our state */
566 tsk_rt(t)->hide_from_aux_tasks = hide; 569 tsk_rt(t)->hide_from_aux_tasks = hide;
567 } 570 }
568#endif 571#endif
572#endif
569} 573}
570 574
571 575