Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234557
b: refs/heads/master
c: 866ab43
h: refs/heads/master
i:
  234555: 19543ce
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Feb 23, 2011
1 parent 6772839 commit 9cd0fdc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cc57aa8f4b3bece8c26c7929728edcc5fa6b5aed
refs/heads/master: 866ab43efd325fae8889ea77a744d03f2b957e38
12 changes: 10 additions & 2 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -2743,7 +2743,7 @@ static inline void update_sg_lb_stats(struct sched_domain *sd,

/*
* Consider the group unbalanced when the imbalance is larger
* than the average weight of two tasks.
* than the average weight of a task.
*
* APZ: with cgroup the avg task weight can vary wildly and
* might not be a suitable number - should we keep a
Expand All @@ -2753,7 +2753,7 @@ static inline void update_sg_lb_stats(struct sched_domain *sd,
if (sgs->sum_nr_running)
avg_load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running;

if ((max_cpu_load - min_cpu_load) > 2*avg_load_per_task && max_nr_running > 1)
if ((max_cpu_load - min_cpu_load) >= avg_load_per_task && max_nr_running > 1)
sgs->group_imb = 1;

sgs->group_capacity = DIV_ROUND_CLOSEST(group->cpu_power, SCHED_LOAD_SCALE);
Expand Down Expand Up @@ -3128,6 +3128,14 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
if (!sds.busiest || sds.busiest_nr_running == 0)
goto out_balanced;

/*
* If the busiest group is imbalanced the below checks don't
* work because they assumes all things are equal, which typically
* isn't true due to cpus_allowed constraints and the like.
*/
if (sds.group_imb)
goto force_balance;

/* SD_BALANCE_NEWIDLE trumps SMP nice when underutilized */
if (idle == CPU_NEWLY_IDLE && sds.this_has_capacity &&
!sds.busiest_has_capacity)
Expand Down

0 comments on commit 9cd0fdc

Please sign in to comment.