Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8356
b: refs/heads/master
c: 0c117f1
h: refs/heads/master
v: v3
  • Loading branch information
Siddha, Suresh B authored and Linus Torvalds committed Sep 10, 2005
1 parent 32ecdd1 commit 4c963a2
Show file tree
Hide file tree
Showing 2 changed files with 8 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: fa3b6ddc3f4a8eadba52234134cdb59c28b5332d
refs/heads/master: 0c117f1b4d14380baeed9c883f765ee023da8761
9 changes: 7 additions & 2 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
{
struct sched_group *busiest = NULL, *this = NULL, *group = sd->groups;
unsigned long max_load, avg_load, total_load, this_load, total_pwr;
unsigned long max_pull;
int load_idx;

max_load = this_load = total_load = total_pwr = 0;
Expand Down Expand Up @@ -1959,7 +1960,7 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
group = group->next;
} while (group != sd->groups);

if (!busiest || this_load >= max_load)
if (!busiest || this_load >= max_load || max_load <= SCHED_LOAD_SCALE)
goto out_balanced;

avg_load = (SCHED_LOAD_SCALE * total_load) / total_pwr;
Expand All @@ -1979,8 +1980,12 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
* by pulling tasks to us. Be careful of negative numbers as they'll
* appear as very large values with unsigned longs.
*/

/* Don't want to pull so many tasks that a group would go idle */
max_pull = min(max_load - avg_load, max_load - SCHED_LOAD_SCALE);

/* How much load to actually move to equalise the imbalance */
*imbalance = min((max_load - avg_load) * busiest->cpu_power,
*imbalance = min(max_pull * busiest->cpu_power,
(avg_load - this_load) * this->cpu_power)
/ SCHED_LOAD_SCALE;

Expand Down

0 comments on commit 4c963a2

Please sign in to comment.