aboutsummaryrefslogtreecommitdiff
path: root/kernel/sched_fair.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-12-01 12:21:47 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-20 13:18:10 -0700
commit58e9934fe305f5c2caeb252cfc478c9111841d6f (patch)
treeb0469904ae71ca1302b25416d44482aa28c8aa58 /kernel/sched_fair.c
parent6c55d19c1d235c267b151d1d6e55a9d6fd5b5161 (diff)
sched: Remove unnecessary RCU exclusion
commit fb58bac5c75bfff8bbf7d02071a10a62f32fe28b upstream As Nick pointed out, and realized by myself when doing: sched: Fix balance vs hotplug race the patch: sched: for_each_domain() vs RCU is wrong, sched_domains are freed after synchronize_sched(), which means disabling preemption is enough. Reported-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r--kernel/sched_fair.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index be3450816f9..d2c46e761fc 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1410,7 +1410,6 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
new_cpu = prev_cpu;
}
- rcu_read_lock();
for_each_domain(cpu, tmp) {
if (!(tmp->flags & SD_LOAD_BALANCE))
continue;
@@ -1500,10 +1499,8 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
}
}
- if (affine_sd && wake_affine(affine_sd, p, sync)) {
- new_cpu = cpu;
- goto out;
- }
+ if (affine_sd && wake_affine(affine_sd, p, sync))
+ return cpu;
while (sd) {
int load_idx = sd->forkexec_idx;
@@ -1544,8 +1541,6 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
/* while loop will break here if sd == NULL */
}
-out:
- rcu_read_unlock();
return new_cpu;
}
#endif /* CONFIG_SMP */