Messages in this thread Patch in this message | | | Date | Tue, 10 Apr 2012 22:22:48 +0800 | Subject | [patch] DLS: refactor task_woken_dl | From | Hillf Danton <> |
| |
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@gmail.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) --
| |