aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-04-16 08:59:29 -0400
committerIngo Molnar <mingo@elte.hu>2010-04-23 05:02:02 -0400
commit669c55e9f99b90e46eaa0f98a67ec53d46dc969a (patch)
tree9f60bcf779e5ec786c05b8053b59e091edcb418c /kernel/sched.c
parent74f5187ac873042f502227701ed1727e7c5fbfa9 (diff)
sched: Pre-compute cpumask_weight(sched_domain_span(sd))
Dave reported that his large SPARC machines spend lots of time in hweight64(), try and optimize some of those needless cpumask_weight() invocations (esp. with the large offstack cpumasks these are very expensive indeed). Reported-by: David Miller <davem@davemloft.net> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 0cc913a8554f..4956ed092838 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6271,6 +6271,9 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
6271 struct rq *rq = cpu_rq(cpu); 6271 struct rq *rq = cpu_rq(cpu);
6272 struct sched_domain *tmp; 6272 struct sched_domain *tmp;
6273 6273
6274 for (tmp = sd; tmp; tmp = tmp->parent)
6275 tmp->span_weight = cpumask_weight(sched_domain_span(tmp));
6276
6274 /* Remove the sched domains which do not contribute to scheduling. */ 6277 /* Remove the sched domains which do not contribute to scheduling. */
6275 for (tmp = sd; tmp; ) { 6278 for (tmp = sd; tmp; ) {
6276 struct sched_domain *parent = tmp->parent; 6279 struct sched_domain *parent = tmp->parent;