Index: linux-2.6.8-rc1-ck/kernel/sched.c =================================================================== --- linux-2.6.8-rc1-ck.orig/kernel/sched.c 2004-07-15 11:29:50.000000000 +1000 +++ linux-2.6.8-rc1-ck/kernel/sched.c 2004-07-21 02:27:59.951415980 +1000 @@ -200,10 +200,15 @@ return rr_interval; } +static unsigned int slice(task_t *p); + static int task_preempts_curr(struct task_struct *p, runqueue_t *rq) { - if (p->prio >= rq->curr->prio) + if (p->prio > rq->curr->prio) return 0; + if (p->prio == rq->curr->prio && (p->slice < slice(p) || + p->slice <= rq->curr->slice)) + return 0; if (!sched_compute || rq->cache_ticks >= cache_decay_ticks || rt_task(p) || (batch_task(rq->curr) && !batch_task(p))) return 1;