--- linux-2.5.75-mm1/kernel/sched.c 2003-07-13 00:21:30.000000000 +1000 +++ linux-2.5.75-test/kernel/sched.c 2003-07-15 08:57:16.000000000 +1000 @@ -1278,11 +1278,7 @@ 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. Note: we - * do not update a thread's priority until it either - * goes to sleep or uses up its timeslice. This makes - * it possible for interactive tasks to use up their - * timeslices at their highest priority levels. + * time slice counter and the sleep average. */ if (p->sleep_avg) p->sleep_avg--; @@ -1315,6 +1311,15 @@ void scheduler_tick(int user_ticks, int enqueue_task(p, rq->expired); } else enqueue_task(p, rq->active); + } else if (unlikely(p->prio < effective_prio(p))){ + /* + * Tasks that have lowered their priority are put to the end + * of the active array with their remaining timeslice + */ + dequeue_task(p, rq->active); + set_tsk_need_resched(p); + p->prio = effective_prio(p); + enqueue_task(p, rq->active); } out_unlock: spin_unlock(&rq->lock);