Commit ab19cb23 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 5afcdab7
...@@ -2371,17 +2371,14 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, ...@@ -2371,17 +2371,14 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
if (task_contributes_to_load(p)) if (task_contributes_to_load(p))
rq->nr_uninterruptible--; rq->nr_uninterruptible--;
p->state = TASK_WAKING; p->state = TASK_WAKING;
task_rq_unlock(rq, &flags); __task_rq_unlock(rq);
cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags); cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
if (cpu != orig_cpu) { if (cpu != orig_cpu)
local_irq_save(flags);
rq = cpu_rq(cpu);
update_rq_clock(rq);
set_task_cpu(p, cpu); set_task_cpu(p, cpu);
local_irq_restore(flags);
} rq = __task_rq_lock(p);
rq = task_rq_lock(p, &flags); update_rq_clock(rq);
WARN_ON(p->state != TASK_WAKING); WARN_ON(p->state != TASK_WAKING);
cpu = task_cpu(p); cpu = task_cpu(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment