From e6b58b65441925c307f40ce5bd9d5676750f7601 Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Fri, 18 Jan 2013 11:12:47 -0500 Subject: Increase max aux runtime from 1 jiffy to 4. --- litmus/aux_tasks.c | 58 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/litmus/aux_tasks.c b/litmus/aux_tasks.c index ef26bba3be77..aa851ab2655b 100644 --- a/litmus/aux_tasks.c +++ b/litmus/aux_tasks.c @@ -8,7 +8,7 @@ #include -#define AUX_SLICE_NR_JIFFIES 1 +#define AUX_SLICE_NR_JIFFIES 4 #define AUX_SLICE_NS ((NSEC_PER_SEC / HZ) * AUX_SLICE_NR_JIFFIES) static int admit_aux_task(struct task_struct *t) @@ -51,7 +51,9 @@ int exit_aux_task(struct task_struct *t) BUG_ON(!tsk_rt(t)->is_aux_task); - TRACE_CUR("Aux task %s/%d is exiting from %s/%d.\n", t->comm, t->pid, t->group_leader->comm, t->group_leader->pid); + TRACE_CUR("Aux task %s/%d is exiting from %s/%d.\n", + t->comm, t->pid, + t->group_leader->comm, t->group_leader->pid); tsk_rt(t)->is_aux_task = 0; @@ -83,7 +85,8 @@ static int aux_tasks_increase_priority(struct task_struct *leader, struct task_s TRACE_CUR("skipping non-real-time aux task %s/%d\n", aux->comm, aux->pid); } else if(tsk_rt(aux)->inh_task == hp) { - TRACE_CUR("skipping real-time aux task %s/%d that already inherits from %s/%d\n", aux->comm, aux->pid, hp->comm, hp->pid); + TRACE_CUR("skipping real-time aux task %s/%d that already inherits from %s/%d\n", + aux->comm, aux->pid, hp->comm, hp->pid); } else { // aux tasks don't touch rt locks, so no nested call needed. @@ -138,7 +141,7 @@ int aux_task_owner_increase_priority(struct task_struct *t) leader = t->group_leader; if (!binheap_is_in_heap(&tsk_rt(t)->aux_task_owner_node)) { - WARN_ON(!is_running(t)); + //WARN_ON(!is_running(t)); TRACE_CUR("aux tasks may not inherit from %s/%d in group %s/%d\n", t->comm, t->pid, leader->comm, leader->pid); goto out; @@ -146,16 +149,18 @@ int aux_task_owner_increase_priority(struct task_struct *t) TRACE_CUR("task %s/%d in group %s/%d increasing priority.\n", t->comm, t->pid, leader->comm, leader->pid); - hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + hp = container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); hp_eff = effective_priority(hp); if (hp != t) { /* our position in the heap may have changed. hp is already at the root. */ binheap_decrease(&tsk_rt(t)->aux_task_owner_node, &tsk_aux(leader)->aux_task_owners); } - hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + hp = container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); if (effective_priority(hp) != hp_eff) { /* the eff. prio. of hp has changed */ hp_eff = effective_priority(hp); @@ -183,7 +188,7 @@ int aux_task_owner_decrease_priority(struct task_struct *t) leader = t->group_leader; if (!binheap_is_in_heap(&tsk_rt(t)->aux_task_owner_node)) { - WARN_ON(!is_running(t)); + //WARN_ON(!is_running(t)); TRACE_CUR("aux tasks may not inherit from %s/%d in group %s/%d\n", t->comm, t->pid, leader->comm, leader->pid); goto out; @@ -191,8 +196,9 @@ int aux_task_owner_decrease_priority(struct task_struct *t) TRACE_CUR("task %s/%d in group %s/%d decresing priority.\n", t->comm, t->pid, leader->comm, leader->pid); - hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + hp = container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); hp_eff = effective_priority(hp); binheap_delete(&tsk_rt(t)->aux_task_owner_node, &tsk_aux(leader)->aux_task_owners); binheap_add(&tsk_rt(t)->aux_task_owner_node, &tsk_aux(leader)->aux_task_owners, @@ -200,8 +206,9 @@ int aux_task_owner_decrease_priority(struct task_struct *t) if (hp == t) { /* t was originally the hp */ struct task_struct *new_hp = - container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); if (effective_priority(new_hp) != hp_eff) { /* eff prio. of hp has changed */ hp_eff = effective_priority(new_hp); TRACE_CUR("%s/%d is no longer hp in group %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid); @@ -241,8 +248,9 @@ int make_aux_task_if_required(struct task_struct *t) if (!binheap_empty(&tsk_aux(leader)->aux_task_owners)) { struct task_struct *hp = - container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); TRACE_CUR("hp in group: %s/%d\n", hp->comm, hp->pid); @@ -287,8 +295,9 @@ long enable_aux_task_owner(struct task_struct *t) binheap_add(&tsk_rt(t)->aux_task_owner_node, &tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node); - hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + hp = container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); if (hp == t) { /* we're the new hp */ TRACE_CUR("%s/%d is new hp in group %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid); @@ -325,13 +334,15 @@ long disable_aux_task_owner(struct task_struct *t) TRACE_CUR("task %s/%d exiting from group %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid); - hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + hp = container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); binheap_delete(&tsk_rt(t)->aux_task_owner_node, &tsk_aux(leader)->aux_task_owners); if (!binheap_empty(&tsk_aux(leader)->aux_task_owners)) { - new_hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + new_hp = container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); } if (hp == t && new_hp != t) { @@ -443,8 +454,9 @@ static long __do_enable_aux_tasks(int flags) #ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE if (aux_tasks_added && !binheap_empty(&tsk_aux(leader)->aux_task_owners)) { - struct task_struct *hp = container_of(binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), - struct task_struct, rt_param); + struct task_struct *hp = container_of( + binheap_top_entry(&tsk_aux(leader)->aux_task_owners, struct rt_param, aux_task_owner_node), + struct task_struct, rt_param); TRACE_CUR("hp in group: %s/%d\n", hp->comm, hp->pid); retval = aux_tasks_increase_priority(leader, (tsk_rt(hp)->inh_task)? tsk_rt(hp)->inh_task : hp); } -- cgit v1.2.2