From 5f73f6b75bb8d37de13eea4278b36a3767e6ef5a Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Tue, 14 May 2013 19:05:27 -0400 Subject: hoist task wakeups out of DGL crit csx's. a very ugly kludge. wake ups are queued in a per-cpu buffer. lock, unlock, and budget operations that affect priority then have to flush the wake queue. --- litmus/sched_crm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'litmus/sched_crm.c') diff --git a/litmus/sched_crm.c b/litmus/sched_crm.c index b3f98f17ac0b..a60f819138d8 100644 --- a/litmus/sched_crm.c +++ b/litmus/sched_crm.c @@ -780,7 +780,7 @@ static enum hrtimer_restart crm_simple_io_on_exhausted(struct task_struct *t, in else { lt_t remaining; crm_domain_t *cluster; - unsigned long flags; + unsigned long flags, kludge_flags; BUG_ON(in_schedule); @@ -793,6 +793,8 @@ static enum hrtimer_restart crm_simple_io_on_exhausted(struct task_struct *t, in /* force job completion */ TRACE_TASK(t, "blocked, postponing deadline\n"); + local_irq_save(kludge_flags); + /* Outermost lock of the cluster. Recursive lock calls are * possible on this code path. This should be the _ONLY_ * scenario where recursive calls are made. */ @@ -867,6 +869,8 @@ static enum hrtimer_restart crm_simple_io_on_exhausted(struct task_struct *t, in #else raw_readyq_unlock_irqrestore(&cluster->cluster_lock, flags); #endif + flush_pending_wakes(); + local_irq_restore(kludge_flags); /* we need to set up the budget timer since we're within the callback. */ hrtimer_forward_now(&get_budget_timer(t).timer.timer, @@ -972,7 +976,7 @@ static enum hrtimer_restart crm_sobliv_on_exhausted(struct task_struct *t, int i else { lt_t remaining; crm_domain_t *cluster; - unsigned long flags; + unsigned long flags, kludge_flags; BUG_ON(in_schedule); @@ -988,6 +992,7 @@ static enum hrtimer_restart crm_sobliv_on_exhausted(struct task_struct *t, int i /* Outermost lock of the cluster. Recursive lock calls are * possible on this code path. This should be the _ONLY_ * scenario where recursive calls are made. */ + local_irq_save(kludge_flags); #ifdef CONFIG_LITMUS_DGL_SUPPORT /* Unfortunately, we _might_ need to grab the DGL lock, so we * must grab it every time since it must be take before the @@ -1062,6 +1067,8 @@ static enum hrtimer_restart crm_sobliv_on_exhausted(struct task_struct *t, int i #else raw_readyq_unlock_irqrestore(&cluster->cluster_lock, flags); #endif + flush_pending_wakes(); + local_irq_restore(kludge_flags); /* we need to set up the budget timer since we're within the callback. */ if (bt_flag_is_set(t, BTF_IS_TOP_M)) { @@ -2677,6 +2684,7 @@ static long crm_activate_plugin(void) /* de-allocate old clusters, if any */ cleanup_crm(); + printk(KERN_INFO "C-RM: Activate Plugin, cluster configuration = %d\n", cluster_config); @@ -2818,6 +2826,8 @@ static long crm_activate_plugin(void) init_nvidia_info(); #endif + init_wake_queues(); + free_cpumask_var(mask); clusters_allocated = 1; return 0; -- cgit v1.2.2