[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1197227804.6991.29.camel@earth>
Date: Sun, 09 Dec 2007 20:16:44 +0100
From: Dmitry Adamushko <dmitry.adamushko@...il.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: Steven Rostedt <srostedt@...hat.com>,
Gregory Haskins <ghaskins@...ell.com>,
LKML Kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH, cleaun-up git-sched 2/3] get rid of 'new_cpu' in
try_to_wake_up()
From: Dmitry Adamushko <dmitry.adamushko@...il.com>
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@...il.com>
---
diff --git a/kernel/sched.c b/kernel/sched.c
index 91f4ea5..285003b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1553,9 +1553,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;
@@ -1573,9 +1570,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);
@@ -1602,10 +1599,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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists