aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_fair.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-09-10 12:18:47 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-15 10:01:06 -0400
commit83f54960c11a14942ab00b54c51e91906b9d8235 (patch)
tree6c7df778777568bb0c7375b4e7ec84ed532809df /kernel/sched_fair.c
parentae154be1f34a674e6cbb43ccf6e442f56acd7a70 (diff)
sched: for_each_domain() vs RCU
for_each_domain() uses RCU to serialize the sched_domains, except it doesn't actually use rcu_read_lock() and instead relies on disabling preemption -> FAIL. XXX: audit other sched_domain code. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r--kernel/sched_fair.c9
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
1422out:
1423 rcu_read_unlock();
1419 return new_cpu; 1424 return new_cpu;
1420} 1425}
1421#endif /* CONFIG_SMP */ 1426#endif /* CONFIG_SMP */