[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBAyOxHOhbkdJmou+P0=MhnyXG2b2ChRpS9jhd05VWKHxw@mail.gmail.com>
Date: Tue, 10 Apr 2012 22:22:48 +0800
From: Hillf Danton <dhillf@...il.com>
To: Dario Faggioli <raistlin@...ux.it>,
Juri Lelli <juri.lelli@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Hillf Danton <dhillf@...il.com>
Subject: [patch] DLS: refactor task_woken_dl
We try to push if the current task is not preempted.
For higher success rate, push only if the next pushable task is updated.
Signed-off-by: Hillf Danton <dhillf@...il.com>
---
--- a/kernel/sched_dl.c Mon Apr 9 19:39:56 2012
+++ b/kernel/sched_dl.c Tue Apr 10 21:09:26 2012
@@ -1372,23 +1372,6 @@ static void post_schedule_dl(struct rq *
push_dl_tasks(rq);
}
-/*
- * Since the task is not running and a reschedule is not going to happen
- * anytime soon on its runqueue, we try pushing it away now.
- */
-static void task_woken_dl(struct rq *rq, struct task_struct *p)
-{
- if (!task_running(rq, p) &&
- !test_tsk_need_resched(rq->curr) &&
- has_pushable_dl_tasks(rq) &&
- p->dl.nr_cpus_allowed > 1 &&
- dl_task(rq->curr) &&
- (rq->curr->dl.nr_cpus_allowed < 2 ||
- dl_entity_preempt(&rq->curr->dl, &p->dl))) {
- push_dl_tasks(rq);
- }
-}
-
static void set_cpus_allowed_dl(struct task_struct *p,
const struct cpumask *new_mask)
{
@@ -1458,6 +1441,22 @@ static inline void init_sched_dl_class(v
GFP_KERNEL, cpu_to_node(i));
}
+/*
+ * Since the task is not running and a reschedule is not going to happen
+ * anytime soon on its runqueue, we try pushing it away now.
+ */
+static void task_woken_dl(struct rq *rq, struct task_struct *p)
+{
+ if (!task_running(rq, p) &&
+ !test_tsk_need_resched(rq->curr) &&
+ p->dl.nr_cpus_allowed > 1)
+ /*
+ * For higher success rate, push if woken task is
+ * the next pushable.
+ */
+ if (p == pick_next_pushable_dl_task(rq))
+ push_dl_tasks(rq);
+}
#endif /* CONFIG_SMP */
static void switched_from_dl(struct rq *rq, struct task_struct *p)
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists