diff options
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index eaa00014b499..43dc6d1d9e88 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1331,6 +1331,7 @@ static int select_task_rq_fair(struct task_struct *p, int flag, int sync) | |||
1331 | new_cpu = prev_cpu; | 1331 | new_cpu = prev_cpu; |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | rcu_read_lock(); | ||
1334 | for_each_domain(cpu, tmp) { | 1335 | for_each_domain(cpu, tmp) { |
1335 | /* | 1336 | /* |
1336 | * If power savings logic is enabled for a domain, see if we | 1337 | * If power savings logic is enabled for a domain, see if we |
@@ -1369,8 +1370,10 @@ static int select_task_rq_fair(struct task_struct *p, int flag, int sync) | |||
1369 | if (want_affine && (tmp->flags & SD_WAKE_AFFINE) && | 1370 | if (want_affine && (tmp->flags & SD_WAKE_AFFINE) && |
1370 | cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) { | 1371 | cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) { |
1371 | 1372 | ||
1372 | if (wake_affine(tmp, p, sync)) | 1373 | if (wake_affine(tmp, p, sync)) { |
1373 | return cpu; | 1374 | new_cpu = cpu; |
1375 | goto out; | ||
1376 | } | ||
1374 | 1377 | ||
1375 | want_affine = 0; | 1378 | want_affine = 0; |
1376 | } | 1379 | } |
@@ -1416,6 +1419,8 @@ static int select_task_rq_fair(struct task_struct *p, int flag, int sync) | |||
1416 | /* while loop will break here if sd == NULL */ | 1419 | /* while loop will break here if sd == NULL */ |
1417 | } | 1420 | } |
1418 | 1421 | ||
1422 | out: | ||
1423 | rcu_read_unlock(); | ||
1419 | return new_cpu; | 1424 | return new_cpu; |
1420 | } | 1425 | } |
1421 | #endif /* CONFIG_SMP */ | 1426 | #endif /* CONFIG_SMP */ |