From: Namhyung Kim <namhyung@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: LKML <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung.kim@lge.com>,
Mike Galbraith <efault@gmx.de>,
Preeti U Murthy <preeti@linux.vnet.ibm.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Alex Shi <alex.shi@intel.com>
Subject: [PATCH] sched: Get rid of unnecessary checks from select_idle_sibling
Date: Wed, 9 Jan 2013 15:50:56 +0900 [thread overview]
Message-ID: <1357714256-24373-1-git-send-email-namhyung@kernel.org> (raw)
From: Namhyung Kim <namhyung.kim@lge.com>
AFAICS @target cpu of select_idle_sibling() is always either prev_cpu
or this_cpu. So no need to check it again and the conditionals can be
consolidated.
Cc: Mike Galbraith <efault@gmx.de>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Alex Shi <alex.shi@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
kernel/sched/fair.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5eea8707234a..af665814c216 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3254,25 +3254,16 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
*/
static int select_idle_sibling(struct task_struct *p, int target)
{
- int cpu = smp_processor_id();
- int prev_cpu = task_cpu(p);
struct sched_domain *sd;
struct sched_group *sg;
int i;
/*
- * If the task is going to be woken-up on this cpu and if it is
- * already idle, then it is the right target.
- */
- if (target == cpu && idle_cpu(cpu))
- return cpu;
-
- /*
- * If the task is going to be woken-up on the cpu where it previously
- * ran and if it is currently idle, then it the right target.
+ * If the task is going to be woken-up on this cpu or the cpu where it
+ * previously ran and it is already idle, then it is the right target.
*/
- if (target == prev_cpu && idle_cpu(prev_cpu))
- return prev_cpu;
+ if (idle_cpu(target))
+ return target;
/*
* Otherwise, iterate the domains and find an elegible idle cpu.
--
1.7.11.7
next reply other threads:[~2013-01-09 6:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-09 6:50 Namhyung Kim [this message]
2013-01-09 7:33 ` Alex Shi
2013-01-09 7:38 ` Alex Shi
2013-01-09 8:00 ` Namhyung Kim
2013-01-09 7:54 ` Namhyung Kim
2013-01-09 8:34 ` Alex Shi
2013-01-10 5:52 ` Namhyung Kim
2013-01-11 2:36 ` Alex Shi
2013-01-09 8:21 ` Preeti U Murthy
2013-01-10 5:49 ` Namhyung Kim
2013-01-10 8:19 ` Preeti U Murthy
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=1357714256-24373-1-git-send-email-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=alex.shi@intel.com \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=preeti@linux.vnet.ibm.com \
--cc=vincent.guittot@linaro.org \
/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
all inboxes | Powered by JetHome®