Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44515
b: refs/heads/master
c: cd7175e
h: refs/heads/master
i:
  44513: 52b5ac5
  44511: 838b816
v: v3
  • Loading branch information
Eric Dumazet authored and Linus Torvalds committed Dec 13, 2006
1 parent b1140c1 commit 939995e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: f988443a84528bd30c2f474efa5e2c511959f19b
refs/heads/master: cd7175edf963a92b2c3cd491d3e34afd357e7284
14 changes: 9 additions & 5 deletions trunk/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,11 +1146,15 @@ static inline void calc_load(unsigned long ticks)
unsigned long active_tasks; /* fixed-point */
static int count = LOAD_FREQ;

active_tasks = count_active_tasks();
for (count -= ticks; count < 0; count += LOAD_FREQ) {
CALC_LOAD(avenrun[0], EXP_1, active_tasks);
CALC_LOAD(avenrun[1], EXP_5, active_tasks);
CALC_LOAD(avenrun[2], EXP_15, active_tasks);
count -= ticks;
if (unlikely(count < 0)) {
active_tasks = count_active_tasks();
do {
CALC_LOAD(avenrun[0], EXP_1, active_tasks);
CALC_LOAD(avenrun[1], EXP_5, active_tasks);
CALC_LOAD(avenrun[2], EXP_15, active_tasks);
count += LOAD_FREQ;
} while (count < 0);
}
}

Expand Down

0 comments on commit 939995e

Please sign in to comment.