[RFC PATCH 3/6] sched/rt: Check to push FIFO current away at each tick

From: Xunlei Pang
Date: Sun Apr 26 2015 - 13:12:56 EST


From: Xunlei Pang <pang.xunlei@xxxxxxxxxx>

There may be some non-migratable tasks queued in the "run queue"
with the same priority as current which is FIFO and migratable,
so at each tick we can check and try to push current away and
give these tasks a chance of running(we don't do this for tasks
queued with lower priority).

Signed-off-by: Xunlei Pang <pang.xunlei@xxxxxxxxxx>
---
kernel/sched/rt.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 7b76747..ddd5b19 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2314,10 +2314,17 @@ static void task_tick_rt(struct rq *rq, struct task_struct *p, int queued)

/*
* RR tasks need a special form of timeslice management.
- * FIFO tasks have no timeslices.
+ * FIFO tasks have no timeslices. But if p(current) is a
+ * FIFO task, try to push it away.
*/
- if (p->policy != SCHED_RR)
+ if (p->policy != SCHED_RR) {
+ if (p->nr_cpus_allowed > 1 &&
+ rq->rt.rt_nr_running > 1 &&
+ !test_tsk_need_resched(p))
+ check_preempt_equal_prio_common(rq);
+
return;
+ }

if (--p->rt.time_slice)
return;
--
1.9.1


--
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/