From: Xunlei Pang <xlpang@126.com>
To: linux-kernel@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Juri Lelli <juri.lelli@gmail.com>, Ingo Molnar <mingo@redhat.com>,
Xunlei Pang <pang.xunlei@linaro.org>
Subject: [RFC PATCH 3/6] sched/rt: Check to push FIFO current away at each tick
Date: Mon, 27 Apr 2015 01:10:55 +0800 [thread overview]
Message-ID: <1430068258-1960-3-git-send-email-xlpang@126.com> (raw)
In-Reply-To: <1430068258-1960-1-git-send-email-xlpang@126.com>
From: Xunlei Pang <pang.xunlei@linaro.org>
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@linaro.org>
---
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
next prev parent reply other threads:[~2015-04-26 17:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-26 17:10 [RFC PATCH 1/6] sched/rt: Provide new check_preempt_equal_prio_common() Xunlei Pang
2015-04-26 17:10 ` [RFC PATCH 2/6] sched/rt: Check to push task away when its affinity is changed Xunlei Pang
2015-04-26 17:10 ` Xunlei Pang [this message]
2015-04-26 18:12 ` [RFC PATCH 3/6] sched/rt: Check to push FIFO current away at each tick Steven Rostedt
2015-04-26 17:10 ` [RFC PATCH 4/6] lib/plist: Provide plist_add_head() for nodes with the same prio Xunlei Pang
2015-04-26 17:10 ` [RFC PATCH 5/6] sched/rt: Fix wrong SMP scheduler behavior for equal prio cases Xunlei Pang
2015-04-26 17:10 ` [RFC PATCH 6/6] sched/rt: Requeue p back if the preemption of check_preempt_equal_prio_common() failed Xunlei Pang
2015-04-26 18:33 ` [RFC PATCH 1/6] sched/rt: Provide new check_preempt_equal_prio_common() Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1430068258-1960-3-git-send-email-xlpang@126.com \
--to=xlpang@126.com \
--cc=juri.lelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pang.xunlei@linaro.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®