All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: fix conflict of schedule domain balance in RT scheduling
@ 2011-06-01 13:58 Hillf Danton
  2011-06-02 11:56 ` Peter Zijlstra
  2011-06-03 14:19 ` Steven Rostedt
  0 siblings, 2 replies; 7+ messages in thread
From: Hillf Danton @ 2011-06-01 13:58 UTC (permalink / raw)
  To: LKML
  Cc: Steven Rostedt, Mike Galbraith, Yong Zhang, Peter Zijlstra, Ingo Molnar

SD_BALANCE_WAKE and SD_WAKE_AFFINE are defined to be mutually exclusive, and
are checked in select_task_rq_rt() and find_lowest_rq() respectively.

The target cpu that is elected only from schedule domains of SD_WAKE_AFFINE if
CPU topology concerned, conflicts with the SD_BALANCE_WAKE requirement.

And checking for cache-hot is also added to confirm the comment there.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
 kernel/sched_rt.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 88725c9..87c44e6 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1005,7 +1005,7 @@ select_task_rq_rt(struct task_struct *p, int
sd_flag, int flags)
 	struct rq *rq;
 	int cpu;

-	if (sd_flag != SD_BALANCE_WAKE)
+	if (!(sd_flag & SD_BALANCE_WAKE))
 		return smp_processor_id();

 	cpu = task_cpu(p);
@@ -1253,7 +1253,8 @@ static int find_lowest_rq(struct task_struct *task)
 	 * We prioritize the last cpu that the task executed on since
 	 * it is most likely cache-hot in that location.
 	 */
-	if (cpumask_test_cpu(cpu, lowest_mask))
+	if (cpumask_test_cpu(cpu, lowest_mask) &&
+	    task_hot(task, task_rq(task)->clock_task, NULL))
 		return cpu;

 	/*
@@ -1265,7 +1266,7 @@ static int find_lowest_rq(struct task_struct *task)

 	rcu_read_lock();
 	for_each_domain(cpu, sd) {
-		if (sd->flags & SD_WAKE_AFFINE) {
+		if (sd->flags & (SD_WAKE_AFFINE | SD_BALANCE_WAKE)) {
 			int best_cpu;

 			/*

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

end of thread, other threads:[~2011-06-03 15:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01 13:58 [PATCH] sched: fix conflict of schedule domain balance in RT scheduling Hillf Danton
2011-06-02 11:56 ` Peter Zijlstra
2011-06-03 14:38   ` Hillf Danton
2011-06-03 14:19 ` Steven Rostedt
2011-06-03 14:30   ` Hillf Danton
2011-06-03 14:52     ` Steven Rostedt
2011-06-03 15:21       ` Hillf Danton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.