[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-308a623a40ce168eb234ea82c2bd13ff85a098d9@git.kernel.org>
Date: Tue, 4 Nov 2014 08:10:51 -0800
From: tip-bot for Wanpeng Li <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: ktkhai@...allels.com, juri.lelli@....com, tglx@...utronix.de,
rostedt@...dmis.org, mingo@...nel.org, wanpeng.li@...ux.intel.com,
torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
peterz@...radead.org, hpa@...or.com
Subject: [tip:sched/core] sched/rt: Clean up check_preempt_equal_prio()
Commit-ID: 308a623a40ce168eb234ea82c2bd13ff85a098d9
Gitweb: http://git.kernel.org/tip/308a623a40ce168eb234ea82c2bd13ff85a098d9
Author: Wanpeng Li <wanpeng.li@...ux.intel.com>
AuthorDate: Fri, 31 Oct 2014 06:39:31 +0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 4 Nov 2014 07:17:52 +0100
sched/rt: Clean up check_preempt_equal_prio()
This patch checks if current can be pushed/pulled somewhere else
in advance to make logic clear, the same behavior as dl class.
- If current can't be migrated, useless to reschedule, let's hope
task can move out.
- If task is migratable, so let's not schedule it and see if it
can be pushed or pulled somewhere else.
Signed-off-by: Wanpeng Li <wanpeng.li@...ux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Juri Lelli <juri.lelli@....com>
Cc: Kirill Tkhai <ktkhai@...allels.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Link: http://lkml.kernel.org/r/1414708776-124078-1-git-send-email-wanpeng.li@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/rt.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index d024e6c..3d14312 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1351,16 +1351,22 @@ out:
static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p)
{
- if (rq->curr->nr_cpus_allowed == 1)
+ /*
+ * Current can't be migrated, useless to reschedule,
+ * let's hope p can move out.
+ */
+ if (rq->curr->nr_cpus_allowed == 1 ||
+ !cpupri_find(&rq->rd->cpupri, rq->curr, NULL))
return;
+ /*
+ * p is migratable, so let's not schedule it and
+ * see if it is pushed or pulled somewhere else.
+ */
if (p->nr_cpus_allowed != 1
&& cpupri_find(&rq->rd->cpupri, p, NULL))
return;
- if (!cpupri_find(&rq->rd->cpupri, rq->curr, NULL))
- return;
-
/*
* There appears to be other cpus that can accept
* current and none to run 'p', so lets reschedule
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists