[PATCH] sched/deadline: reschedule from switched_from_dl() after a successful pull

From: Juri Lelli
Date: Thu Oct 30 2014 - 06:15:40 EST


In switched_from_dl() we have to issue a resched if we
successfully pulled some task from other cpus.
This patch also aligns the behaviour with -rt.

Signed-off-by: Juri Lelli <juri.lelli@xxxxxxx>
Suggested-by: Wanpeng Li <wanpeng.li@xxxxxxxxxxxxxxx>
---
kernel/sched/deadline.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index db6ad38..e8943fc 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1623,8 +1623,11 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p)
* this is the right place to try to pull some other one
* from an overloaded cpu, if any.
*/
- if (!rq->dl.dl_nr_running)
- pull_dl_task(rq);
+ if (!task_on_rq_queued(p) || rq->dl.dl_nr_running)
+ return;
+
+ if (pull_dl_task(rq))
+ resched_curr(rq);
#endif
}

--
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/