All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Call update_group_power only for local_group
@ 2010-07-01 23:12 Venkatesh Pallipadi
  2010-07-02  8:05 ` Peter Zijlstra
  0 siblings, 1 reply; 17+ messages in thread
From: Venkatesh Pallipadi @ 2010-07-01 23:12 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: LKML, Gautham R Shenoy, Joel Schopp, Venkatesh Pallipadi

commit 871e35b moved update_group_power() call in update_sg_lb_stats(),
resulting in it being called for each group, even though it only updates
the power of local group. As a result we have frequent redundant
update_group_power() calls.

Move it back under "if (local_group)" condition.

This reduces the number of calls to update_group_power by a factor of 4
on my 4 core in 4 NUMA nodes test system.

Signed-off-by: Venkatesh Pallipadi <venki@google.com>
---
 kernel/sched_fair.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index a878b53..369d53d 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -2359,8 +2359,11 @@ static inline void update_sg_lb_stats(struct sched_domain *sd,
 	unsigned int balance_cpu = -1, first_idle_cpu = 0;
 	unsigned long avg_load_per_task = 0;
 
-	if (local_group)
+	if (local_group) {
 		balance_cpu = group_first_cpu(group);
+		update_group_power(sd, this_cpu);
+	}
+
 
 	/* Tally up the load of all CPUs in the group */
 	max_cpu_load = 0;
@@ -2406,8 +2409,6 @@ static inline void update_sg_lb_stats(struct sched_domain *sd,
 		return;
 	}
 
-	update_group_power(sd, this_cpu);
-
 	/* Adjust by relative CPU power of the group */
 	sgs->avg_load = (sgs->group_load * SCHED_LOAD_SCALE) / group->cpu_power;
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-07-17 11:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01 23:12 [PATCH] sched: Call update_group_power only for local_group Venkatesh Pallipadi
2010-07-02  8:05 ` Peter Zijlstra
2010-07-02 16:20   ` Venkatesh Pallipadi
2010-07-02 16:40     ` Peter Zijlstra
2010-07-02 16:56       ` Venkatesh Pallipadi
2010-07-02 17:31         ` Peter Zijlstra
2010-07-08 14:12         ` Peter Zijlstra
2010-07-08 17:45           ` Suresh Siddha
2010-07-08 17:49             ` Peter Zijlstra
2010-07-08 17:50               ` Suresh Siddha
2010-07-08 17:55                 ` Peter Zijlstra
2010-07-08 18:16             ` Peter Zijlstra
2010-07-08 21:53               ` Suresh Siddha
2010-07-09 13:17                 ` Peter Zijlstra
2010-07-17 11:12                 ` [tip:sched/core] sched: Update rq->clock for nohz balanced cpus tip-bot for Suresh Siddha
2010-07-12 17:11               ` [PATCH] sched: Call update_group_power only for local_group Venkatesh Pallipadi
2010-07-17 11:12               ` [tip:sched/core] sched: Reduce update_group_power() calls tip-bot for Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.