From: Con Kolivas A heck of a lot fairer on disk only tasks; lets them earn sleep avg up to just interactive state so they stay on the active array. kernel/sched.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff -puN kernel/sched.c~o13.1int kernel/sched.c --- 25/kernel/sched.c~o13.1int 2003-08-23 13:57:31.000000000 -0700 +++ 25-akpm/kernel/sched.c 2003-08-23 13:57:31.000000000 -0700 @@ -583,13 +583,16 @@ repeat_lock_task: goto repeat_lock_task; } if (old_state == TASK_UNINTERRUPTIBLE){ + rq->nr_uninterruptible--; /* * Tasks on involuntary sleep don't earn - * sleep_avg + * sleep_avg beyond just interactive state. */ - rq->nr_uninterruptible--; - p->timestamp = sched_clock(); - p->activated = -1; + if (NS_TO_JIFFIES(p->sleep_avg) >= + JUST_INTERACTIVE_SLEEP(p)){ + p->timestamp = sched_clock(); + p->activated = -1; + } } if (sync) __activate_task(p, rq); _