public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/6] sched/rt: cleanup check preempt equal prio
@ 2014-10-30 22:39 Wanpeng Li
  2014-10-30 22:39 ` [PATCH v3 2/6] sched/deadline: fix artificial overrun introduced by yield_task_dl Wanpeng Li
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Wanpeng Li @ 2014-10-30 22:39 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra
  Cc: Juri Lelli, Kirill Tkhai, juri.lelli, linux-kernel, Wanpeng Li

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@linux.intel.com>
---
v2 -> v3:
 * cleanup subject/comments
 * align multi-line if() correctly

 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..a0b51aa 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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-04 16:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30 22:39 [PATCH v3 1/6] sched/rt: cleanup check preempt equal prio Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 2/6] sched/deadline: fix artificial overrun introduced by yield_task_dl Wanpeng Li
2014-11-04 16:11   ` [tip:sched/core] sched/deadline: Fix artificial overrun introduced by yield_task_dl() tip-bot for Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 3/6] sched/deadline: add deadline rq status print Wanpeng Li
2014-11-04 16:11   ` [tip:sched/core] sched/deadline: Add " tip-bot for Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 4/6] sched/deadline: push task away if the deadline is equal to curr during wakeup Wanpeng Li
2014-11-04 16:11   ` [tip:sched/core] sched/deadline: Push " tip-bot for Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 5/6] sched/deadline: reschedule from switched_from_dl() after a successful pull Wanpeng Li
2014-11-04 16:11   ` [tip:sched/core] sched/deadline: Reschedule from switched_from_dl () " tip-bot for Wanpeng Li
2014-10-30 22:39 ` [PATCH v3 6/6] sched/deadline: don't check CONFIG_SMP in switched_from_dl Wanpeng Li
2014-11-04 16:12   ` [tip:sched/core] sched/deadline: Don' t check CONFIG_SMP in switched_from_dl() tip-bot for Wanpeng Li
2014-11-04 16:10 ` [tip:sched/core] sched/rt: Clean up check_preempt_equal_prio() tip-bot for Wanpeng Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox