From 3eb35b8b204e167af82b9b34fdb53bcee92a520e Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 10 Sep 2009 18:18:47 +0200 Subject: [PATCH] --- yaml --- r: 163000 b: refs/heads/master c: 83f54960c11a14942ab00b54c51e91906b9d8235 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/sched_fair.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index f06a40b840dd..dbb26f8db94b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ae154be1f34a674e6cbb43ccf6e442f56acd7a70 +refs/heads/master: 83f54960c11a14942ab00b54c51e91906b9d8235 diff --git a/trunk/kernel/sched_fair.c b/trunk/kernel/sched_fair.c index eaa00014b499..43dc6d1d9e88 100644 --- a/trunk/kernel/sched_fair.c +++ b/trunk/kernel/sched_fair.c @@ -1331,6 +1331,7 @@ static int select_task_rq_fair(struct task_struct *p, int flag, int sync) new_cpu = prev_cpu; } + rcu_read_lock(); for_each_domain(cpu, tmp) { /* * 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) if (want_affine && (tmp->flags & SD_WAKE_AFFINE) && cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) { - if (wake_affine(tmp, p, sync)) - return cpu; + if (wake_affine(tmp, p, sync)) { + new_cpu = cpu; + goto out; + } want_affine = 0; } @@ -1416,6 +1419,8 @@ static int select_task_rq_fair(struct task_struct *p, int flag, int sync) /* while loop will break here if sd == NULL */ } +out: + rcu_read_unlock(); return new_cpu; } #endif /* CONFIG_SMP */