diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-04-26 15:03:33 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-04-26 15:03:33 -0400 |
commit | 01b6745cf326ac316eef0b02e9f01f16a74298ae (patch) | |
tree | 4a14212170c5e651008960ca85bcc4d14acde03f | |
parent | 5e73c0954ed9e0599051d79e529e92fd87ce99d2 (diff) |
printk() info for tasks that fail to be admitted
-rw-r--r-- | litmus/litmus.c | 13 | ||||
-rw-r--r-- | litmus/sched_cedf.c | 29 |
2 files changed, 25 insertions, 17 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c index 112e269a6348..6c0ad0b4513a 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -128,7 +128,9 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param) | |||
128 | if (min(tp.relative_deadline, tp.period) < tp.exec_cost) /*density check*/ | 128 | if (min(tp.relative_deadline, tp.period) < tp.exec_cost) /*density check*/ |
129 | { | 129 | { |
130 | printk(KERN_INFO "litmus: real-time task %d rejected " | 130 | printk(KERN_INFO "litmus: real-time task %d rejected " |
131 | "because task density > 1.0\n", pid); | 131 | "because task density > 1.0: exec_cost = %llu, deadline = %llu\n", |
132 | tp.exec_cost, min(tp.relative_deadline, tp.period), | ||
133 | pid); | ||
132 | goto out_unlock; | 134 | goto out_unlock; |
133 | } | 135 | } |
134 | if (tp.cls != RT_CLASS_HARD && | 136 | if (tp.cls != RT_CLASS_HARD && |
@@ -572,6 +574,12 @@ long litmus_admit_task(struct task_struct* tsk) | |||
572 | if (get_rt_relative_deadline(tsk) == 0 || | 574 | if (get_rt_relative_deadline(tsk) == 0 || |
573 | get_exec_cost(tsk) > | 575 | get_exec_cost(tsk) > |
574 | min(get_rt_relative_deadline(tsk), get_rt_period(tsk)) ) { | 576 | min(get_rt_relative_deadline(tsk), get_rt_period(tsk)) ) { |
577 | printk("%s/%d " | ||
578 | "litmus admit: invalid task parameters " | ||
579 | "(e = %lu, p = %lu, d = %lu)\n", | ||
580 | tsk->comm, tsk->pid, | ||
581 | get_exec_cost(tsk), get_rt_period(tsk), | ||
582 | get_rt_relative_deadline(tsk)); | ||
575 | TRACE_TASK(tsk, | 583 | TRACE_TASK(tsk, |
576 | "litmus admit: invalid task parameters " | 584 | "litmus admit: invalid task parameters " |
577 | "(e = %lu, p = %lu, d = %lu)\n", | 585 | "(e = %lu, p = %lu, d = %lu)\n", |
@@ -582,6 +590,9 @@ long litmus_admit_task(struct task_struct* tsk) | |||
582 | } | 590 | } |
583 | 591 | ||
584 | if (!cpu_online(get_partition(tsk))) { | 592 | if (!cpu_online(get_partition(tsk))) { |
593 | printk("%s/%d " | ||
594 | "litmus admit: cpu %d is not online\n", | ||
595 | tsk->comm, tsk->pid, get_partition(tsk)); | ||
585 | TRACE_TASK(tsk, "litmus admit: cpu %d is not online\n", | 596 | TRACE_TASK(tsk, "litmus admit: cpu %d is not online\n", |
586 | get_partition(tsk)); | 597 | get_partition(tsk)); |
587 | retval = -EINVAL; | 598 | retval = -EINVAL; |
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c index 1a7f0ffdae33..c4df3778c6a2 100644 --- a/litmus/sched_cedf.c +++ b/litmus/sched_cedf.c | |||
@@ -206,14 +206,14 @@ static void cedf_track_in_top_m(struct task_struct *t) | |||
206 | 206 | ||
207 | //BUG_ON(binheap_is_in_heap(&tsk_rt(t)->budget.top_m_node)); | 207 | //BUG_ON(binheap_is_in_heap(&tsk_rt(t)->budget.top_m_node)); |
208 | if (binheap_is_in_heap(&tsk_rt(t)->budget.top_m_node)) { | 208 | if (binheap_is_in_heap(&tsk_rt(t)->budget.top_m_node)) { |
209 | TRACE_TASK(t, "apparently already being tracked. top-m?: %s\n", | 209 | // TRACE_TASK(t, "apparently already being tracked. top-m?: %s\n", |
210 | (bt_flag_is_set(t, BTF_IS_TOP_M)) ? "Yes":"No"); | 210 | // (bt_flag_is_set(t, BTF_IS_TOP_M)) ? "Yes":"No"); |
211 | return; | 211 | return; |
212 | } | 212 | } |
213 | 213 | ||
214 | /* TODO: do cluster_size-1 if release master is in this cluster */ | 214 | /* TODO: do cluster_size-1 if release master is in this cluster */ |
215 | if (cluster->top_m_size < cluster_size) { | 215 | if (cluster->top_m_size < cluster_size) { |
216 | TRACE_TASK(t, "unconditionally adding task to top-m.\n"); | 216 | // TRACE_TASK(t, "unconditionally adding task to top-m.\n"); |
217 | binheap_add(&tsk_rt(t)->budget.top_m_node, &cluster->top_m, | 217 | binheap_add(&tsk_rt(t)->budget.top_m_node, &cluster->top_m, |
218 | struct budget_tracker, top_m_node); | 218 | struct budget_tracker, top_m_node); |
219 | ++cluster->top_m_size; | 219 | ++cluster->top_m_size; |
@@ -233,8 +233,8 @@ static void cedf_track_in_top_m(struct task_struct *t) | |||
233 | rt_param); | 233 | rt_param); |
234 | 234 | ||
235 | if (__edf_higher_prio(t, BASE, mth_highest, BASE)) { | 235 | if (__edf_higher_prio(t, BASE, mth_highest, BASE)) { |
236 | TRACE_TASK(t, "adding to top-m (evicting %s/%d)\n", | 236 | // TRACE_TASK(t, "adding to top-m (evicting %s/%d)\n", |
237 | mth_highest->comm, mth_highest->pid); | 237 | // mth_highest->comm, mth_highest->pid); |
238 | 238 | ||
239 | binheap_delete_root(&cluster->top_m, struct budget_tracker, top_m_node); | 239 | binheap_delete_root(&cluster->top_m, struct budget_tracker, top_m_node); |
240 | INIT_BINHEAP_NODE(&tsk_rt(mth_highest)->budget.top_m_node); | 240 | INIT_BINHEAP_NODE(&tsk_rt(mth_highest)->budget.top_m_node); |
@@ -250,7 +250,7 @@ static void cedf_track_in_top_m(struct task_struct *t) | |||
250 | budget_state_machine(t,on_enter_top_m); | 250 | budget_state_machine(t,on_enter_top_m); |
251 | } | 251 | } |
252 | else { | 252 | else { |
253 | TRACE_TASK(t, "adding to not-top-m\n"); | 253 | // TRACE_TASK(t, "adding to not-top-m\n"); |
254 | binheap_add(&tsk_rt(t)->budget.top_m_node, | 254 | binheap_add(&tsk_rt(t)->budget.top_m_node, |
255 | &cluster->not_top_m, | 255 | &cluster->not_top_m, |
256 | struct budget_tracker, top_m_node); | 256 | struct budget_tracker, top_m_node); |
@@ -263,12 +263,12 @@ static void cedf_untrack_in_top_m(struct task_struct *t) | |||
263 | cedf_domain_t *cluster = task_cpu_cluster(t); | 263 | cedf_domain_t *cluster = task_cpu_cluster(t); |
264 | 264 | ||
265 | if (!binheap_is_in_heap(&tsk_rt(t)->budget.top_m_node)) { | 265 | if (!binheap_is_in_heap(&tsk_rt(t)->budget.top_m_node)) { |
266 | TRACE_TASK(t, "is not being tracked\n"); /* BUG() on this case? */ | 266 | // TRACE_TASK(t, "is not being tracked\n"); /* BUG() on this case? */ |
267 | return; | 267 | return; |
268 | } | 268 | } |
269 | 269 | ||
270 | if (bt_flag_is_set(t, BTF_IS_TOP_M)) { | 270 | if (bt_flag_is_set(t, BTF_IS_TOP_M)) { |
271 | TRACE_TASK(t, "removing task from top-m\n"); | 271 | // TRACE_TASK(t, "removing task from top-m\n"); |
272 | 272 | ||
273 | /* delete t's entry */ | 273 | /* delete t's entry */ |
274 | binheap_delete(&tsk_rt(t)->budget.top_m_node, &cluster->top_m); | 274 | binheap_delete(&tsk_rt(t)->budget.top_m_node, &cluster->top_m); |
@@ -285,7 +285,7 @@ static void cedf_untrack_in_top_m(struct task_struct *t) | |||
285 | struct task_struct, | 285 | struct task_struct, |
286 | rt_param); | 286 | rt_param); |
287 | 287 | ||
288 | TRACE_TASK(to_move, "being promoted to top-m\n"); | 288 | // TRACE_TASK(to_move, "being promoted to top-m\n"); |
289 | 289 | ||
290 | binheap_delete_root(&cluster->not_top_m, struct budget_tracker, top_m_node); | 290 | binheap_delete_root(&cluster->not_top_m, struct budget_tracker, top_m_node); |
291 | INIT_BINHEAP_NODE(&tsk_rt(to_move)->budget.top_m_node); | 291 | INIT_BINHEAP_NODE(&tsk_rt(to_move)->budget.top_m_node); |
@@ -301,7 +301,7 @@ static void cedf_untrack_in_top_m(struct task_struct *t) | |||
301 | } | 301 | } |
302 | } | 302 | } |
303 | else { | 303 | else { |
304 | TRACE_TASK(t, "removing task from not-top-m\n"); | 304 | // TRACE_TASK(t, "removing task from not-top-m\n"); |
305 | binheap_delete(&tsk_rt(t)->budget.top_m_node, &cluster->not_top_m); | 305 | binheap_delete(&tsk_rt(t)->budget.top_m_node, &cluster->not_top_m); |
306 | } | 306 | } |
307 | } | 307 | } |
@@ -1800,19 +1800,16 @@ if (current != t) and t is linked (but not scheduled?), do something. | |||
1800 | 1800 | ||
1801 | #ifdef CONFIG_REALTIME_AUX_TASKS | 1801 | #ifdef CONFIG_REALTIME_AUX_TASKS |
1802 | /* make sure we clean up on our way out */ | 1802 | /* make sure we clean up on our way out */ |
1803 | if (unlikely(tsk_rt(t)->is_aux_task)) { | 1803 | if (unlikely(tsk_rt(t)->is_aux_task)) |
1804 | exit_aux_task(t); | 1804 | exit_aux_task(t); |
1805 | } | 1805 | else if(tsk_rt(t)->has_aux_tasks) |
1806 | else if(tsk_rt(t)->has_aux_tasks) { | ||
1807 | disable_aux_task_owner(t); | 1806 | disable_aux_task_owner(t); |
1808 | } | ||
1809 | #endif | 1807 | #endif |
1810 | 1808 | ||
1811 | #ifdef CONFIG_LITMUS_NVIDIA | 1809 | #ifdef CONFIG_LITMUS_NVIDIA |
1812 | /* make sure we clean up on our way out */ | 1810 | /* make sure we clean up on our way out */ |
1813 | if(tsk_rt(t)->held_gpus) { | 1811 | if(tsk_rt(t)->held_gpus) |
1814 | disable_gpu_owner(t); | 1812 | disable_gpu_owner(t); |
1815 | } | ||
1816 | #endif | 1813 | #endif |
1817 | 1814 | ||
1818 | unlink(t); | 1815 | unlink(t); |