|
@@ -1263,6 +1263,7 @@ static int find_lowest_rq(struct task_struct *task)
|
|
if (!cpumask_test_cpu(this_cpu, lowest_mask))
|
|
if (!cpumask_test_cpu(this_cpu, lowest_mask))
|
|
this_cpu = -1; /* Skip this_cpu opt if not among lowest */
|
|
this_cpu = -1; /* Skip this_cpu opt if not among lowest */
|
|
|
|
|
|
|
|
+ rcu_read_lock();
|
|
for_each_domain(cpu, sd) {
|
|
for_each_domain(cpu, sd) {
|
|
if (sd->flags & SD_WAKE_AFFINE) {
|
|
if (sd->flags & SD_WAKE_AFFINE) {
|
|
int best_cpu;
|
|
int best_cpu;
|
|
@@ -1272,15 +1273,20 @@ static int find_lowest_rq(struct task_struct *task)
|
|
* remote processor.
|
|
* remote processor.
|
|
*/
|
|
*/
|
|
if (this_cpu != -1 &&
|
|
if (this_cpu != -1 &&
|
|
- cpumask_test_cpu(this_cpu, sched_domain_span(sd)))
|
|
|
|
|
|
+ cpumask_test_cpu(this_cpu, sched_domain_span(sd))) {
|
|
|
|
+ rcu_read_unlock();
|
|
return this_cpu;
|
|
return this_cpu;
|
|
|
|
+ }
|
|
|
|
|
|
best_cpu = cpumask_first_and(lowest_mask,
|
|
best_cpu = cpumask_first_and(lowest_mask,
|
|
sched_domain_span(sd));
|
|
sched_domain_span(sd));
|
|
- if (best_cpu < nr_cpu_ids)
|
|
|
|
|
|
+ if (best_cpu < nr_cpu_ids) {
|
|
|
|
+ rcu_read_unlock();
|
|
return best_cpu;
|
|
return best_cpu;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ rcu_read_unlock();
|
|
|
|
|
|
/*
|
|
/*
|
|
* And finally, if there were no matches within the domains
|
|
* And finally, if there were no matches within the domains
|