From: Hillf Danton <dhillf@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Gregory Haskins <ghaskins@novell.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] sched: use plist in pulling RT task
Date: Sun, 26 Jun 2011 17:50:10 +0800 [thread overview]
Message-ID: <BANLkTimQRtQ9F7w+dEL+PQPDQWRLaSkimA@mail.gmail.com> (raw)
In-Reply-To: <1308921701.17580.9.camel@gandalf.stny.rr.com>
Hi Steven
It is reprepared according to your comments, difference from the last version
is the following,
1, pulled_prio is dropped since it is no more than the highest curr,
2, test p->prio < src_rq->curr->prio is kept as it was,
3, cleanup of a few typo.
Thanks
Hillf
---
kernel/sched_rt.c | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index b03cd89..b5aca9c 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1502,18 +1502,17 @@ static int pull_rt_task(struct rq *this_rq)
/*
* Are there still pullable RT tasks?
*/
- if (src_rq->rt.rt_nr_running <= 1)
+ if (!has_pushable_tasks(src_rq))
goto skip;
- p = pick_next_highest_task_rt(src_rq, this_cpu);
-
/*
* Do we have an RT task that preempts
* the to-be-scheduled task?
*/
- if (p && (p->prio < this_rq->rt.highest_prio.curr)) {
- WARN_ON(p == src_rq->curr);
- WARN_ON(!p->on_rq);
+ plist_for_each_entry(p, &src_rq->rt.pushable_tasks,
+ pushable_tasks) {
+ if (p->prio >= this_rq->rt.highest_prio.curr)
+ break;
/*
* There's a chance that p is higher in priority
@@ -1526,17 +1525,15 @@ static int pull_rt_task(struct rq *this_rq)
if (p->prio < src_rq->curr->prio)
goto skip;
+ if (!cpumask_test_cpu(this_cpu, &p->cpus_allowed))
+ continue;
+
ret = 1;
deactivate_task(src_rq, p, 0);
set_task_cpu(p, this_cpu);
activate_task(this_rq, p, 0);
- /*
- * We continue with the search, just in
- * case there's an even higher prio task
- * in another runqueue. (low likelihood
- * but possible)
- */
+ break;
}
skip:
double_unlock_balance(this_rq, src_rq);
prev parent reply other threads:[~2011-06-26 9:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 12:53 Hillf Danton
2011-06-24 13:21 ` Steven Rostedt
2011-06-26 9:50 ` Hillf Danton [this message]
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=BANLkTimQRtQ9F7w+dEL+PQPDQWRLaSkimA@mail.gmail.com \
--to=dhillf@gmail.com \
--cc=ghaskins@novell.com \
--cc=linux-kernel@vger.kernel.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®