diff options
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 652e8bdef9aa..493472984879 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1046,17 +1046,21 @@ static void yield_task_fair(struct rq *rq) | |||
1046 | * search starts with cpus closest then further out as needed, | 1046 | * search starts with cpus closest then further out as needed, |
1047 | * so we always favor a closer, idle cpu. | 1047 | * so we always favor a closer, idle cpu. |
1048 | * Domains may include CPUs that are not usable for migration, | 1048 | * Domains may include CPUs that are not usable for migration, |
1049 | * hence we need to mask them out (cpu_active_mask) | 1049 | * hence we need to mask them out (rq->rd->online) |
1050 | * | 1050 | * |
1051 | * Returns the CPU we should wake onto. | 1051 | * Returns the CPU we should wake onto. |
1052 | */ | 1052 | */ |
1053 | #if defined(ARCH_HAS_SCHED_WAKE_IDLE) | 1053 | #if defined(ARCH_HAS_SCHED_WAKE_IDLE) |
1054 | |||
1055 | #define cpu_rd_active(cpu, rq) cpumask_test_cpu(cpu, rq->rd->online) | ||
1056 | |||
1054 | static int wake_idle(int cpu, struct task_struct *p) | 1057 | static int wake_idle(int cpu, struct task_struct *p) |
1055 | { | 1058 | { |
1056 | struct sched_domain *sd; | 1059 | struct sched_domain *sd; |
1057 | int i; | 1060 | int i; |
1058 | unsigned int chosen_wakeup_cpu; | 1061 | unsigned int chosen_wakeup_cpu; |
1059 | int this_cpu; | 1062 | int this_cpu; |
1063 | struct rq *task_rq = task_rq(p); | ||
1060 | 1064 | ||
1061 | /* | 1065 | /* |
1062 | * At POWERSAVINGS_BALANCE_WAKEUP level, if both this_cpu and prev_cpu | 1066 | * At POWERSAVINGS_BALANCE_WAKEUP level, if both this_cpu and prev_cpu |
@@ -1089,10 +1093,10 @@ static int wake_idle(int cpu, struct task_struct *p) | |||
1089 | for_each_domain(cpu, sd) { | 1093 | for_each_domain(cpu, sd) { |
1090 | if ((sd->flags & SD_WAKE_IDLE) | 1094 | if ((sd->flags & SD_WAKE_IDLE) |
1091 | || ((sd->flags & SD_WAKE_IDLE_FAR) | 1095 | || ((sd->flags & SD_WAKE_IDLE_FAR) |
1092 | && !task_hot(p, task_rq(p)->clock, sd))) { | 1096 | && !task_hot(p, task_rq->clock, sd))) { |
1093 | for_each_cpu_and(i, sched_domain_span(sd), | 1097 | for_each_cpu_and(i, sched_domain_span(sd), |
1094 | &p->cpus_allowed) { | 1098 | &p->cpus_allowed) { |
1095 | if (cpu_active(i) && idle_cpu(i)) { | 1099 | if (cpu_rd_active(i, task_rq) && idle_cpu(i)) { |
1096 | if (i != task_cpu(p)) { | 1100 | if (i != task_cpu(p)) { |
1097 | schedstat_inc(p, | 1101 | schedstat_inc(p, |
1098 | se.nr_wakeups_idle); | 1102 | se.nr_wakeups_idle); |