Commit 5d2f5a61 authored by Dmitry Adamushko's avatar Dmitry Adamushko Committed by Ingo Molnar

sched: get rid of 'new_cpu' in try_to_wake_up()

Clean-up try_to_wake_up().

Get rid of the 'new_cpu' variable in try_to_wake_up() [ that's, one
#ifdef section less ].  Also remove a few redundant blank lines.
Signed-off-by: default avatarDmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9ec3b77e
...@@ -1559,9 +1559,6 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync) ...@@ -1559,9 +1559,6 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
unsigned long flags; unsigned long flags;
long old_state; long old_state;
struct rq *rq; struct rq *rq;
#ifdef CONFIG_SMP
int new_cpu;
#endif
rq = task_rq_lock(p, &flags); rq = task_rq_lock(p, &flags);
old_state = p->state; old_state = p->state;
...@@ -1579,9 +1576,9 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync) ...@@ -1579,9 +1576,9 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
if (unlikely(task_running(rq, p))) if (unlikely(task_running(rq, p)))
goto out_activate; goto out_activate;
new_cpu = p->sched_class->select_task_rq(p, sync); cpu = p->sched_class->select_task_rq(p, sync);
if (new_cpu != cpu) { if (cpu != orig_cpu) {
set_task_cpu(p, new_cpu); set_task_cpu(p, cpu);
task_rq_unlock(rq, &flags); task_rq_unlock(rq, &flags);
/* might preempt at this point */ /* might preempt at this point */
rq = task_rq_lock(p, &flags); rq = task_rq_lock(p, &flags);
...@@ -1608,10 +1605,8 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync) ...@@ -1608,10 +1605,8 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
} }
} }
} }
#endif #endif
out_activate: out_activate:
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
schedstat_inc(p, se.nr_wakeups); schedstat_inc(p, se.nr_wakeups);
......
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