--- linux-2.6.0-test2-mm1/kernel/sched.c 2003-07-30 20:54:54.000000000 +1000 +++ linux-2.6.0-test2mm1O11/kernel/sched.c 2003-08-01 02:40:07.000000000 +1000 @@ -1255,10 +1255,13 @@ void scheduler_tick(int user_ticks, int spin_lock(&rq->lock); /* * The task was running during this tick - update the - * time slice counter and the sleep average. + * time slice counter and the sleep average. Fully interactive + * tasks lose progressively less sleep_avg as they become + * cpu hogs. */ - if (p->sleep_avg) - p->sleep_avg--; + if (p->sleep_avg && (!p->interactive_credit || !(jiffies % + (MAX_BONUS + 1 - (p->sleep_avg * MAX_BONUS / MAX_SLEEP_AVG))))) + p->sleep_avg--; if (unlikely(rt_task(p))) { /* * RR tasks need a special form of timeslice management. @@ -1289,7 +1292,7 @@ void scheduler_tick(int user_ticks, int if (p->interactive_credit) p->interactive_credit--; - if (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq)) { + if (p->mm && (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq))) { if (!rq->expired_timestamp) rq->expired_timestamp = jiffies; enqueue_task(p, rq->expired);