Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24920
b: refs/heads/master
c: e72ff0b
h: refs/heads/master
v: v3
  • Loading branch information
Con Kolivas authored and Linus Torvalds committed Mar 31, 2006
1 parent 335c527 commit 30b5d87
Show file tree
Hide file tree
Showing 2 changed files with 11 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: e7c38cb49c6cc05bc11f70d9e9889da1c4a0d37f
refs/heads/master: e72ff0bb2c163eb13014ba113701bd42dab382fe
15 changes: 10 additions & 5 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,14 +700,19 @@ static int recalc_task_prio(task_t *p, unsigned long long now)
if (likely(sleep_time > 0)) {
/*
* User tasks that sleep a long time are categorised as
* idle and will get just interactive status to stay active &
* prevent them suddenly becoming cpu hogs and starving
* other processes.
* idle. They will only have their sleep_avg increased to a
* level that makes them just interactive priority to stay
* active yet prevent them suddenly becoming cpu hogs and
* starving other processes.
*/
if (p->mm && p->sleep_type != SLEEP_NONINTERACTIVE &&
sleep_time > INTERACTIVE_SLEEP(p)) {
p->sleep_avg = JIFFIES_TO_NS(MAX_SLEEP_AVG -
DEF_TIMESLICE);
unsigned long ceiling;

ceiling = JIFFIES_TO_NS(MAX_SLEEP_AVG -
DEF_TIMESLICE);
if (p->sleep_avg < ceiling)
p->sleep_avg = ceiling;
} else {
/*
* Tasks waking from uninterruptible sleep are
Expand Down

0 comments on commit 30b5d87

Please sign in to comment.