From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <srostedt@redhat.com>,
Gregory Haskins <ghaskins@novell.com>,
LKML Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH, cleaun-up git-sched 2/3] get rid of 'new_cpu' in try_to_wake_up()
Date: Sun, 09 Dec 2007 20:16:44 +0100 [thread overview]
Message-ID: <1197227804.6991.29.camel@earth> (raw)
From: Dmitry Adamushko <dmitry.adamushko@gmail.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@gmail.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);
next reply other threads:[~2007-12-09 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-09 19:16 Dmitry Adamushko [this message]
2007-12-10 8:38 ` [PATCH, cleaun-up git-sched 2/3] get rid of 'new_cpu' in try_to_wake_up() Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1197227804.6991.29.camel@earth \
--to=dmitry.adamushko@gmail.com \
--cc=ghaskins@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=srostedt@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox