aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGautham R Shenoy <ego@in.ibm.com>2009-09-02 07:29:10 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-04 04:09:56 -0400
commitd899a789c28ded9c72b57ddb61868d6b8fc23e80 (patch)
tree0b636ca14480093af22e64e09d1d72632d26fbd7
parentbdb94aa5dbd8b55e75f5a50b61312fe589e2c2d1 (diff)
sched: Try to deal with low capacity, fix update_sd_power_savings_stats()
sgs.group_capacity can now be 0, if for some reason group->__cpu_power happens to be less than SCHED_LOAD_SCALE/2. In that case, we need the following fix to make it work for update_sd_power_savings_stats(). That's because both sum_nr_running and group_capacity are unsigned longs. Cc: Gautham R Shenoy <ego@in.ibm.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Andreas Herrmann <andreas.herrmann3@amd.com> Cc: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 5f5b359b01b8..e1ebf9b00f5d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3668,7 +3668,7 @@ static inline void update_sd_power_savings_stats(struct sched_group *group,
3668 * capacity but still has some space to pick up some load 3668 * capacity but still has some space to pick up some load
3669 * from other group and save more power 3669 * from other group and save more power
3670 */ 3670 */
3671 if (sgs->sum_nr_running > sgs->group_capacity - 1) 3671 if (sgs->sum_nr_running + 1 > sgs->group_capacity)
3672 return; 3672 return;
3673 3673
3674 if (sgs->sum_nr_running > sds->leader_nr_running || 3674 if (sgs->sum_nr_running > sds->leader_nr_running ||