diff options
author | Dmitry Adamushko <dmitry.adamushko@gmail.com> | 2008-01-25 21:08:21 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-25 21:08:21 +0100 |
commit | 5d2f5a616d65e3c08acde3195694c4ab8afbc1b7 (patch) | |
tree | df44c641af4cd66160f6296e86833c568070ae76 | |
parent | 9ec3b77e11b9398ab40b492c4fde7d8aac04a718 (diff) | |
download | linux-5d2f5a616d65e3c08acde3195694c4ab8afbc1b7.tar.gz linux-5d2f5a616d65e3c08acde3195694c4ab8afbc1b7.tar.bz2 linux-5d2f5a616d65e3c08acde3195694c4ab8afbc1b7.zip |
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: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/sched.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 55c521780f93..9d6fb731559b 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1559,9 +1559,6 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync) unsigned long flags; long old_state; struct rq *rq; -#ifdef CONFIG_SMP - int new_cpu; -#endif rq = task_rq_lock(p, &flags); old_state = p->state; @@ -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))) goto out_activate; - new_cpu = p->sched_class->select_task_rq(p, sync); - if (new_cpu != cpu) { - set_task_cpu(p, new_cpu); + cpu = p->sched_class->select_task_rq(p, sync); + if (cpu != orig_cpu) { + set_task_cpu(p, cpu); task_rq_unlock(rq, &flags); /* might preempt at this point */ 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) } } } - #endif - out_activate: #endif /* CONFIG_SMP */ schedstat_inc(p, se.nr_wakeups); |