diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-11-27 09:44:43 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-09 04:03:04 -0500 |
commit | ab19cb23313733c55e0517607844b86720b35f5f (patch) | |
tree | 0d6780ab6d1e1e97b624e978ed3418e5786646d4 /kernel | |
parent | 5afcdab706d6002cb02b567ba46e650215e694e8 (diff) |
sched: Clean up ttwu() rq locking
Since set_task_clock() doesn't rely on rq->clock anymore we can simplyfy
the mess in ttwu().
Optimize things a bit by not fiddling with the IRQ state there.
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')
-rw-r--r-- | kernel/sched.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 1f9c6d99f15d..c92670f8e097 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2371,17 +2371,14 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, | |||
2371 | if (task_contributes_to_load(p)) | 2371 | if (task_contributes_to_load(p)) |
2372 | rq->nr_uninterruptible--; | 2372 | rq->nr_uninterruptible--; |
2373 | p->state = TASK_WAKING; | 2373 | p->state = TASK_WAKING; |
2374 | task_rq_unlock(rq, &flags); | 2374 | __task_rq_unlock(rq); |
2375 | 2375 | ||
2376 | cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags); | 2376 | cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags); |
2377 | if (cpu != orig_cpu) { | 2377 | if (cpu != orig_cpu) |
2378 | local_irq_save(flags); | ||
2379 | rq = cpu_rq(cpu); | ||
2380 | update_rq_clock(rq); | ||
2381 | set_task_cpu(p, cpu); | 2378 | set_task_cpu(p, cpu); |
2382 | local_irq_restore(flags); | 2379 | |
2383 | } | 2380 | rq = __task_rq_lock(p); |
2384 | rq = task_rq_lock(p, &flags); | 2381 | update_rq_clock(rq); |
2385 | 2382 | ||
2386 | WARN_ON(p->state != TASK_WAKING); | 2383 | WARN_ON(p->state != TASK_WAKING); |
2387 | cpu = task_cpu(p); | 2384 | cpu = task_cpu(p); |