From: tip-bot for Heiko Carstens <heiko.carstens@de.ibm.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
a.p.zijlstra@chello.nl, heiko.carstens@de.ibm.com,
tglx@linutronix.de, mingo@elte.hu
Subject: [tip:sched/core] sched: Merge cpu_to_core_group functions
Date: Thu, 9 Sep 2010 19:46:12 GMT [thread overview]
Message-ID: <tip-f269893c575167447cc9f6d1867e639fb5b6f0c5@git.kernel.org> (raw)
In-Reply-To: <20100831082843.953617555@de.ibm.com>
Commit-ID: f269893c575167447cc9f6d1867e639fb5b6f0c5
Gitweb: http://git.kernel.org/tip/f269893c575167447cc9f6d1867e639fb5b6f0c5
Author: Heiko Carstens <heiko.carstens@de.ibm.com>
AuthorDate: Tue, 31 Aug 2010 10:28:15 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 9 Sep 2010 20:41:18 +0200
sched: Merge cpu_to_core_group functions
Merge and simplify the two cpu_to_core_group variants so that the
resulting function follows the same pattern like cpu_to_phys_group.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100831082843.953617555@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 8eef8e5..1a0c084 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6552,31 +6552,23 @@ cpu_to_cpu_group(int cpu, const struct cpumask *cpu_map,
#ifdef CONFIG_SCHED_MC
static DEFINE_PER_CPU(struct static_sched_domain, core_domains);
static DEFINE_PER_CPU(struct static_sched_group, sched_group_core);
-#endif /* CONFIG_SCHED_MC */
-#if defined(CONFIG_SCHED_MC) && defined(CONFIG_SCHED_SMT)
static int
cpu_to_core_group(int cpu, const struct cpumask *cpu_map,
struct sched_group **sg, struct cpumask *mask)
{
int group;
-
+#ifdef CONFIG_SCHED_SMT
cpumask_and(mask, topology_thread_cpumask(cpu), cpu_map);
group = cpumask_first(mask);
+#else
+ group = cpu;
+#endif
if (sg)
*sg = &per_cpu(sched_group_core, group).sg;
return group;
}
-#elif defined(CONFIG_SCHED_MC)
-static int
-cpu_to_core_group(int cpu, const struct cpumask *cpu_map,
- struct sched_group **sg, struct cpumask *unused)
-{
- if (sg)
- *sg = &per_cpu(sched_group_core, cpu).sg;
- return cpu;
-}
-#endif
+#endif /* CONFIG_SCHED_MC */
static DEFINE_PER_CPU(struct static_sched_domain, phys_domains);
static DEFINE_PER_CPU(struct static_sched_group, sched_group_phys);
next prev parent reply other threads:[~2010-09-09 19:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-31 8:28 [PATCH V2 0/4] sched: add new 'book' scheduling domain Heiko Carstens
2010-08-31 8:28 ` [PATCH V2 1/4] sched: merge cpu_to_core_group functions Heiko Carstens
2010-09-09 19:46 ` tip-bot for Heiko Carstens [this message]
2010-08-31 8:28 ` [PATCH V2 2/4] sched: add book scheduling domain Heiko Carstens
2010-09-09 19:46 ` [tip:sched/core] sched: Add " tip-bot for Heiko Carstens
2010-08-31 8:28 ` [PATCH V2 3/4] topology/sysfs: provide book id and siblings attributes Heiko Carstens
2010-09-09 19:46 ` [tip:sched/core] topology/sysfs: Provide " tip-bot for Heiko Carstens
2010-08-31 8:28 ` [PATCH V2 4/4] topology: add z11 cpu topology support Heiko Carstens
2010-09-09 19:47 ` [tip:sched/core] topology, s390: Add " tip-bot for Heiko Carstens
2010-09-01 10:06 ` [PATCH V2 0/4] sched: add new 'book' scheduling domain Peter Zijlstra
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=tip-f269893c575167447cc9f6d1867e639fb5b6f0c5@git.kernel.org \
--to=heiko.carstens@de.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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®