Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47997
b: refs/heads/master
c: ff91691
h: refs/heads/master
i:
  47995: cb8ebfe
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Feb 12, 2007
1 parent 9690854 commit bea304d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: 0a9ac38246b11892ad20a1eb9deb67adf8c0db2f
refs/heads/master: ff91691bccdb741efb2df0489058a4961fa79598
8 changes: 5 additions & 3 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2897,14 +2897,16 @@ static void active_load_balance(struct rq *busiest_rq, int busiest_cpu)
static void update_load(struct rq *this_rq)
{
unsigned long this_load;
int i, scale;
unsigned int i, scale;

this_load = this_rq->raw_weighted_load;

/* Update our load: */
for (i = 0, scale = 1; i < 3; i++, scale <<= 1) {
for (i = 0, scale = 1; i < 3; i++, scale += scale) {
unsigned long old_load, new_load;

/* scale is effectively 1 << i now, and >> i divides by scale */

old_load = this_rq->cpu_load[i];
new_load = this_load;
/*
Expand All @@ -2914,7 +2916,7 @@ static void update_load(struct rq *this_rq)
*/
if (new_load > old_load)
new_load += scale-1;
this_rq->cpu_load[i] = (old_load*(scale-1) + new_load) / scale;
this_rq->cpu_load[i] = (old_load*(scale-1) + new_load) >> i;
}
}

Expand Down

0 comments on commit bea304d

Please sign in to comment.