From 964297dd588ee6feab1aedecb2611bece2681973 Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Fri, 30 Nov 2012 14:33:52 -0500 Subject: Fix compilation warnings. --- include/litmus/ikglp_lock.h | 2 +- litmus/Kconfig | 22 ++++++++++++++++++++++ litmus/aux_tasks.c | 18 +++++++++--------- litmus/edf_common.c | 21 +++++++-------------- litmus/ikglp_lock.c | 3 +++ 5 files changed, 42 insertions(+), 24 deletions(-) mode change 100644 => 100755 include/litmus/ikglp_lock.h mode change 100644 => 100755 litmus/Kconfig mode change 100644 => 100755 litmus/aux_tasks.c mode change 100644 => 100755 litmus/edf_common.c mode change 100644 => 100755 litmus/ikglp_lock.c diff --git a/include/litmus/ikglp_lock.h b/include/litmus/ikglp_lock.h old mode 100644 new mode 100755 index 89d9c37c7631..af155eadbb35 --- a/include/litmus/ikglp_lock.h +++ b/include/litmus/ikglp_lock.h @@ -114,7 +114,7 @@ struct ikglp_queue_info struct fifo_queue* q; lt_t estimated_len; int *nr_cur_users; - int *nr_aff_users; + int64_t *nr_aff_users; }; struct ikglp_affinity_ops diff --git a/litmus/Kconfig b/litmus/Kconfig old mode 100644 new mode 100755 index a32f42898148..16087b9e4e81 --- a/litmus/Kconfig +++ b/litmus/Kconfig @@ -56,6 +56,26 @@ config REALTIME_AUX_TASKS priority inversions may occur with respect to single-threaded task models if/when one of threads are scheduled simultanously with another of the same identity. + +choice + prompt "Scheduling prioritization of AUX tasks." + default REALTIME_AUX_TASK_PRIORITY_BOOSTED + help + Select the prioritization method for auxillary tasks. + +config REALTIME_AUX_TASK_PRIORITY_BOOSTED + bool "Boosted" + help + Run all auxillary task threads at a maximum priority. Useful for + temporarily working around bugs during development. + +config REALTIME_AUX_TASK_PRIORITY_INHERITANCE + bool "Inheritance" + help + Auxillary tasks inherit the maximum priority from blocked real-time + threads within the same process. + + Additional pitfall: 3) Busy-wait deadlock is likely between normal real-time tasks and auxillary tasks synchronize using _preemptive_ spinlocks that do not use priority inheritance. @@ -73,9 +93,11 @@ config REALTIME_AUX_TASKS holder that blocks the rt task CAN block on I/O and contribute its priority to the aux tasks. Aux tasks may still _indirectly_ inherit the priority of the blocked rt task via the lock holder. +endchoice endmenu + menu "Real-Time Synchronization" config NP_SECTION diff --git a/litmus/aux_tasks.c b/litmus/aux_tasks.c old mode 100644 new mode 100755 index 9572d960b46a..bd7bcbed58fe --- a/litmus/aux_tasks.c +++ b/litmus/aux_tasks.c @@ -50,7 +50,7 @@ int exit_aux_task(struct task_struct *t) TRACE_CUR("Aux task %s/%d is exiting from %s/%d.\n", t->comm, t->pid, leader->comm, leader->pid); -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE list_del(&tsk_rt(t)->aux_task_node); tsk_rt(t)->is_aux_task = 0; @@ -67,7 +67,7 @@ static int aux_tasks_increase_priority(struct task_struct *leader, struct task_s { int retval = 0; -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE struct list_head *pos; TRACE_CUR("Increasing priority of aux tasks in group %s/%d.\n", leader->comm, leader->pid); @@ -94,7 +94,7 @@ static int aux_tasks_decrease_priority(struct task_struct *leader, struct task_s { int retval = 0; -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE struct list_head *pos; TRACE_CUR("Decreasing priority of aux tasks in group %s/%d.\n", leader->comm, leader->pid); @@ -121,7 +121,7 @@ int aux_task_owner_increase_priority(struct task_struct *t) { int retval = 0; -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE struct task_struct *leader; struct task_struct *hp = NULL; struct task_struct *hp_eff = NULL; @@ -166,7 +166,7 @@ int aux_task_owner_decrease_priority(struct task_struct *t) { int retval = 0; -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE struct task_struct *leader; struct task_struct *hp = NULL; struct task_struct *hp_eff = NULL; @@ -214,7 +214,7 @@ long enable_aux_task_owner(struct task_struct *t) { long retval = 0; -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE struct task_struct *leader = t->group_leader; struct task_struct *hp; @@ -252,7 +252,7 @@ long disable_aux_task_owner(struct task_struct *t) { long retval = 0; -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE struct task_struct *leader = t->group_leader; struct task_struct *hp; struct task_struct *new_hp = NULL; @@ -344,7 +344,7 @@ static long __do_enable_aux_tasks(void) /* hasn't been aux_tasks_increase_priorityted into rt. make it a aux. */ tsk_rt(t)->is_aux_task = 1; -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE list_add_tail(&tsk_rt(t)->aux_task_node, &tsk_aux(leader)->aux_tasks); #endif @@ -368,7 +368,7 @@ static long __do_enable_aux_tasks(void) } while(t != leader); -#if 0 +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE 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); diff --git a/litmus/edf_common.c b/litmus/edf_common.c old mode 100644 new mode 100755 index a9bf0c08e125..5a3f5b417f73 --- a/litmus/edf_common.c +++ b/litmus/edf_common.c @@ -43,7 +43,7 @@ static inline long edf_hash(struct task_struct *t) } #endif -#ifdef CONFIG_REALTIME_AUX_TASKS +#ifdef CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE int aux_tie_break(struct task_struct *first, struct task_struct *second) { long fhash = edf_hash(first); @@ -90,9 +90,8 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) return first && !second; } -#ifdef CONFIG_REALTIME_AUX_TASKS - { +#if defined(CONFIG_REALTIME_AUX_TASK_PRIORITY_BOOSTED) /* run aux tasks at max priority */ if (first->rt_param.is_aux_task != second->rt_param.is_aux_task) { @@ -103,9 +102,8 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) first = first->group_leader; second = second->group_leader; } - - -#if 0 +#elif defined(CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE) + { int first_lo_aux, second_lo_aux; int first_hi_aux, second_hi_aux; first_lo_aux = first->rt_param.is_aux_task && !first->rt_param.inh_task; @@ -133,11 +131,10 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) TRACE_CUR("hi aux tie break: %s/%d >> %s/%d --- %d\n", first->comm, first->pid, second->comm, second->pid, aux_hi_tie_break); return aux_hi_tie_break; } -#endif - } #endif + #ifdef CONFIG_LITMUS_LOCKING /* Check for EFFECTIVE priorities. Change task * used for comparison in such a case. @@ -252,14 +249,12 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) else if (first_task->rt_param.is_proxy_thread == second_task->rt_param.is_proxy_thread) { #endif -#if 0 -#ifdef CONFIG_REALTIME_AUX_TASKS +#if defined(CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE) /* is this dead code? */ if (tsk_rt(first)->is_aux_task < tsk_rt(second)->is_aux_task) { return 1; } else if (tsk_rt(first)->is_aux_task == tsk_rt(second)->is_aux_task) { -#endif #endif /* Something could be wrong if you get this far. */ @@ -297,11 +292,9 @@ int edf_higher_prio(struct task_struct* first, struct task_struct* second) return 1; } } -#if 0 -#ifdef CONFIG_REALTIME_AUX_TASKS +#if defined(CONFIG_REALTIME_AUX_TASK_PRIORITY_INHERITANCE) } #endif -#endif #ifdef CONFIG_LITMUS_SOFTIRQD } diff --git a/litmus/ikglp_lock.c b/litmus/ikglp_lock.c old mode 100644 new mode 100755 index 16ae621bbf75..b29828344dd1 --- a/litmus/ikglp_lock.c +++ b/litmus/ikglp_lock.c @@ -2598,7 +2598,10 @@ ikglp_wait_state_t* gpu_ikglp_advise_donor_to_fq(struct ikglp_affinity* aff, str ikglp_wait_state_t *donor = NULL; int distance = MIG_NONE; int gpu = replica_to_gpu(aff, ikglp_get_idx(sem, fq)); + +#ifdef CONFIG_SCHED_DEBUG_TRACE ikglp_wait_state_t* default_donor = binheap_top_entry(&sem->donors, ikglp_wait_state_t, node); +#endif __find_closest_donor(gpu, sem->donors.root, &donor, &distance); -- cgit v1.2.2