lkml.org 
[lkml]   [2011]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] sched: fix conflict of schedule domain balance in RT scheduling
From
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;

/*

\
 
 \ /
  Last update: 2011-06-01 16:01    [W:0.080 / U:14.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site