* [PATCH 1/2] sched: Staticize pick_next_task_dl() and build_sched_domain()
@ 2017-04-27 8:28 Viresh Kumar
2017-04-27 8:29 ` [PATCH 2/2] sched: topology: Initialize span_weight from sd_init() Viresh Kumar
2017-08-10 12:06 ` [tip:sched/core] sched: Mark pick_next_task_dl() and build_sched_domain() as static tip-bot for Viresh Kumar
0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2017-04-27 8:28 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra
Cc: linaro-kernel, linux-kernel, Vincent Guittot, Viresh Kumar
pick_next_task_dl() and build_sched_domain() aren't used outside
deadline.c and topology.c.
Make them static.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
kernel/sched/deadline.c | 2 +-
kernel/sched/topology.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index a2ce59015642..ce9679a633f5 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1168,7 +1168,7 @@ static struct sched_dl_entity *pick_next_dl_entity(struct rq *rq,
return rb_entry(left, struct sched_dl_entity, rb_node);
}
-struct task_struct *
+static struct task_struct *
pick_next_task_dl(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
{
struct sched_dl_entity *dl_se;
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 1b0b4fb12837..09a56ca76bd1 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1351,7 +1351,7 @@ static void __sdt_free(const struct cpumask *cpu_map)
}
}
-struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,
+static struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,
const struct cpumask *cpu_map, struct sched_domain_attr *attr,
struct sched_domain *child, int cpu)
{
--
2.12.0.432.g71c3a4f4ba37
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] sched: topology: Initialize span_weight from sd_init()
2017-04-27 8:28 [PATCH 1/2] sched: Staticize pick_next_task_dl() and build_sched_domain() Viresh Kumar
@ 2017-04-27 8:29 ` Viresh Kumar
2017-08-10 12:06 ` [tip:sched/core] sched: Mark pick_next_task_dl() and build_sched_domain() as static tip-bot for Viresh Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2017-04-27 8:29 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra
Cc: linaro-kernel, linux-kernel, Vincent Guittot, Viresh Kumar
Most of the sched domain structure gets initialized from sd_init() and
it looks reasonable to initialize span_weight too from it.
Currently it is getting initialized from build_sched_domains(), which
doesn't looks to be the ideal place for doing so.
With this change we need to additionally reset span_weight for a special
error case, but that looks reasonable as span_weight must be updated
every time domain span is updated.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
kernel/sched/topology.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 09a56ca76bd1..691b290a679e 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -892,6 +892,7 @@ sd_init(struct sched_domain_topology_level *tl,
.last_balance = jiffies,
.balance_interval = sd_weight,
+ .span_weight = sd_weight,
.smt_gain = 0,
.max_newidle_lb_cost = 0,
.next_decay_max_lb_cost = jiffies,
@@ -1373,6 +1374,7 @@ static struct sched_domain *build_sched_domain(struct sched_domain_topology_leve
cpumask_or(sched_domain_span(sd),
sched_domain_span(sd),
sched_domain_span(child));
+ sd->span_weight = cpumask_weight(sched_domain_span(sd));
}
}
@@ -1417,7 +1419,6 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att
/* Build the groups for the domains */
for_each_cpu(i, cpu_map) {
for (sd = *per_cpu_ptr(d.sd, i); sd; sd = sd->parent) {
- sd->span_weight = cpumask_weight(sched_domain_span(sd));
if (sd->flags & SD_OVERLAP) {
if (build_overlap_sched_groups(sd, i))
goto error;
--
2.12.0.432.g71c3a4f4ba37
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [tip:sched/core] sched: Mark pick_next_task_dl() and build_sched_domain() as static
2017-04-27 8:28 [PATCH 1/2] sched: Staticize pick_next_task_dl() and build_sched_domain() Viresh Kumar
2017-04-27 8:29 ` [PATCH 2/2] sched: topology: Initialize span_weight from sd_init() Viresh Kumar
@ 2017-08-10 12:06 ` tip-bot for Viresh Kumar
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Viresh Kumar @ 2017-08-10 12:06 UTC (permalink / raw)
To: linux-tip-commits
Cc: peterz, mingo, tglx, hpa, viresh.kumar, torvalds, linux-kernel,
vincent.guittot
Commit-ID: 181a80d1f7f453f58c4b47f89084d0849632858c
Gitweb: http://git.kernel.org/tip/181a80d1f7f453f58c4b47f89084d0849632858c
Author: Viresh Kumar <viresh.kumar@linaro.org>
AuthorDate: Thu, 27 Apr 2017 13:58:59 +0530
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 10 Aug 2017 12:18:14 +0200
sched: Mark pick_next_task_dl() and build_sched_domain() as static
pick_next_task_dl() and build_sched_domain() aren't used outside
deadline.c and topology.c.
Make them static.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Link: http://lkml.kernel.org/r/36e4cbb6210002cadae89920ae97e19e7e513008.1493281605.git.viresh.kumar@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/deadline.c | 2 +-
kernel/sched/topology.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 755bd3f..a205ac7 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1655,7 +1655,7 @@ static struct sched_dl_entity *pick_next_dl_entity(struct rq *rq,
return rb_entry(left, struct sched_dl_entity, rb_node);
}
-struct task_struct *
+static struct task_struct *
pick_next_task_dl(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
{
struct sched_dl_entity *dl_se;
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 216fee0..bd8b6d6 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1593,7 +1593,7 @@ static void __sdt_free(const struct cpumask *cpu_map)
}
}
-struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,
+static struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,
const struct cpumask *cpu_map, struct sched_domain_attr *attr,
struct sched_domain *child, int cpu)
{
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-10 12:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 8:28 [PATCH 1/2] sched: Staticize pick_next_task_dl() and build_sched_domain() Viresh Kumar
2017-04-27 8:29 ` [PATCH 2/2] sched: topology: Initialize span_weight from sd_init() Viresh Kumar
2017-08-10 12:06 ` [tip:sched/core] sched: Mark pick_next_task_dl() and build_sched_domain() as static tip-bot for Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).