From: tip-bot for Viresh Kumar <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
peterz@infradead.org, viresh.kumar@linaro.org,
tglx@linutronix.de
Subject: [tip:sched/core] sched: Create for_each_sd_topology()
Date: Wed, 19 Jun 2013 11:40:45 -0700 [thread overview]
Message-ID: <tip-27723a68caf05381b0b0bc6e127da2c9e7bcb775@git.kernel.org> (raw)
In-Reply-To: <e0e04542f54e9464bd9da54f5ccfe62ec6c4c0bc.1370861520.git.viresh.kumar@linaro.org>
Commit-ID: 27723a68caf05381b0b0bc6e127da2c9e7bcb775
Gitweb: http://git.kernel.org/tip/27723a68caf05381b0b0bc6e127da2c9e7bcb775
Author: Viresh Kumar <viresh.kumar@linaro.org>
AuthorDate: Mon, 10 Jun 2013 16:27:20 +0530
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 19 Jun 2013 12:58:45 +0200
sched: Create for_each_sd_topology()
For loop for traversing sched_domain_topology was used at multiple placed in
core.c. This patch removes code redundancy by creating for_each_sd_topology().
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/e0e04542f54e9464bd9da54f5ccfe62ec6c4c0bc.1370861520.git.viresh.kumar@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/core.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 88c2c0e..547b7d3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5565,6 +5565,9 @@ static struct sched_domain_topology_level default_topology[] = {
static struct sched_domain_topology_level *sched_domain_topology = default_topology;
+#define for_each_sd_topology(tl) \
+ for (tl = sched_domain_topology; tl->init; tl++)
+
#ifdef CONFIG_NUMA
static int sched_domains_numa_levels;
@@ -5862,7 +5865,7 @@ static int __sdt_alloc(const struct cpumask *cpu_map)
struct sched_domain_topology_level *tl;
int j;
- for (tl = sched_domain_topology; tl->init; tl++) {
+ for_each_sd_topology(tl) {
struct sd_data *sdd = &tl->data;
sdd->sd = alloc_percpu(struct sched_domain *);
@@ -5915,7 +5918,7 @@ static void __sdt_free(const struct cpumask *cpu_map)
struct sched_domain_topology_level *tl;
int j;
- for (tl = sched_domain_topology; tl->init; tl++) {
+ for_each_sd_topology(tl) {
struct sd_data *sdd = &tl->data;
for_each_cpu(j, cpu_map) {
@@ -5983,7 +5986,7 @@ static int build_sched_domains(const struct cpumask *cpu_map,
struct sched_domain_topology_level *tl;
sd = NULL;
- for (tl = sched_domain_topology; tl->init; tl++) {
+ for_each_sd_topology(tl) {
sd = build_sched_domain(tl, cpu_map, attr, sd, i);
if (tl == sched_domain_topology)
*per_cpu_ptr(d.sd, i) = sd;
next prev parent reply other threads:[~2013-06-19 18:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-10 10:57 [PATCH 0/3] sched: Sched Domains: Fixups Viresh Kumar
2013-06-10 10:57 ` [PATCH 1/3] sched: don't initialize alloc_state in build_sched_domains Viresh Kumar
2013-06-19 18:40 ` [tip:sched/core] sched: Don' t initialize alloc_state in build_sched_domains() tip-bot for Viresh Kumar
2013-06-10 10:57 ` [PATCH 2/3] sched: don't sd->child to NULL when it is already NULL Viresh Kumar
2013-06-10 13:33 ` Viresh Kumar
2013-06-19 18:40 ` [tip:sched/core] sched: Don't set sd-> child " tip-bot for Viresh Kumar
2013-06-10 10:57 ` [PATCH 3/3] sched: Create for_each_sd_topology() Viresh Kumar
2013-06-19 18:40 ` tip-bot for Viresh Kumar [this message]
2013-06-18 10:00 ` [PATCH 0/3] sched: Sched Domains: Fixups 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-27723a68caf05381b0b0bc6e127da2c9e7bcb775@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=viresh.kumar@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
Powered by JetHome