[tip:sched/balancing] sched: Try to deal with low capacity, fix update_sd_power_savings_stats()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  d899a789c28ded9c72b57ddb61868d6b8fc23e80
Gitweb:     http://git.kernel.org/tip/d899a789c28ded9c72b57ddb61868d6b8fc23e80
Author:     Gautham R Shenoy <ego@xxxxxxxxxx>
AuthorDate: Wed, 2 Sep 2009 16:59:10 +0530
Committer:  Ingo Molnar <mingo@xxxxxxx>
CommitDate: Fri, 4 Sep 2009 10:09:56 +0200

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@xxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Andreas Herrmann <andreas.herrmann3@xxxxxxx>
Cc: Balbir Singh <balbir@xxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 5f5b359..e1ebf9b 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,
 	 * capacity but still has some space to pick up some load
 	 * from other group and save more power
 	 */
-	if (sgs->sum_nr_running > sgs->group_capacity - 1)
+	if (sgs->sum_nr_running + 1 > sgs->group_capacity)
 		return;
 
 	if (sgs->sum_nr_running > sds->leader_nr_running ||
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux