|
@@ -5899,8 +5899,8 @@ wake_affine_idle(int this_cpu, int prev_cpu, int sync)
|
|
|
* a cpufreq perspective, it's better to have higher utilisation
|
|
|
* on one CPU.
|
|
|
*/
|
|
|
- if (idle_cpu(this_cpu) && cpus_share_cache(this_cpu, prev_cpu))
|
|
|
- return idle_cpu(prev_cpu) ? prev_cpu : this_cpu;
|
|
|
+ if (available_idle_cpu(this_cpu) && cpus_share_cache(this_cpu, prev_cpu))
|
|
|
+ return available_idle_cpu(prev_cpu) ? prev_cpu : this_cpu;
|
|
|
|
|
|
if (sync && cpu_rq(this_cpu)->nr_running == 1)
|
|
|
return this_cpu;
|
|
@@ -6143,7 +6143,7 @@ find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, int this
|
|
|
|
|
|
/* Traverse only the allowed CPUs */
|
|
|
for_each_cpu_and(i, sched_group_span(group), &p->cpus_allowed) {
|
|
|
- if (idle_cpu(i)) {
|
|
|
+ if (available_idle_cpu(i)) {
|
|
|
struct rq *rq = cpu_rq(i);
|
|
|
struct cpuidle_state *idle = idle_get_state(rq);
|
|
|
if (idle && idle->exit_latency < min_exit_latency) {
|
|
@@ -6272,7 +6272,7 @@ void __update_idle_core(struct rq *rq)
|
|
|
if (cpu == core)
|
|
|
continue;
|
|
|
|
|
|
- if (!idle_cpu(cpu))
|
|
|
+ if (!available_idle_cpu(cpu))
|
|
|
goto unlock;
|
|
|
}
|
|
|
|
|
@@ -6304,7 +6304,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int
|
|
|
|
|
|
for_each_cpu(cpu, cpu_smt_mask(core)) {
|
|
|
cpumask_clear_cpu(cpu, cpus);
|
|
|
- if (!idle_cpu(cpu))
|
|
|
+ if (!available_idle_cpu(cpu))
|
|
|
idle = false;
|
|
|
}
|
|
|
|
|
@@ -6333,7 +6333,7 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t
|
|
|
for_each_cpu(cpu, cpu_smt_mask(target)) {
|
|
|
if (!cpumask_test_cpu(cpu, &p->cpus_allowed))
|
|
|
continue;
|
|
|
- if (idle_cpu(cpu))
|
|
|
+ if (available_idle_cpu(cpu))
|
|
|
return cpu;
|
|
|
}
|
|
|
|
|
@@ -6396,7 +6396,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
|
|
|
return -1;
|
|
|
if (!cpumask_test_cpu(cpu, &p->cpus_allowed))
|
|
|
continue;
|
|
|
- if (idle_cpu(cpu))
|
|
|
+ if (available_idle_cpu(cpu))
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -6416,13 +6416,13 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
|
|
|
struct sched_domain *sd;
|
|
|
int i, recent_used_cpu;
|
|
|
|
|
|
- if (idle_cpu(target))
|
|
|
+ if (available_idle_cpu(target))
|
|
|
return target;
|
|
|
|
|
|
/*
|
|
|
* If the previous CPU is cache affine and idle, don't be stupid:
|
|
|
*/
|
|
|
- if (prev != target && cpus_share_cache(prev, target) && idle_cpu(prev))
|
|
|
+ if (prev != target && cpus_share_cache(prev, target) && available_idle_cpu(prev))
|
|
|
return prev;
|
|
|
|
|
|
/* Check a recently used CPU as a potential idle candidate: */
|
|
@@ -6430,7 +6430,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
|
|
|
if (recent_used_cpu != prev &&
|
|
|
recent_used_cpu != target &&
|
|
|
cpus_share_cache(recent_used_cpu, target) &&
|
|
|
- idle_cpu(recent_used_cpu) &&
|
|
|
+ available_idle_cpu(recent_used_cpu) &&
|
|
|
cpumask_test_cpu(p->recent_used_cpu, &p->cpus_allowed)) {
|
|
|
/*
|
|
|
* Replace recent_used_cpu with prev as it is a potential
|