From: Con Kolivas <kernel@kolivas.org>

Updated the O5int patch to just one change and backed out the others 
that could be causing problems:

Changes
Tasks that drop their priority while running are now put to the end of the
queue to continue their timeslice. Fixes a little flutter when tasks are
cpu hogs for short periods (eg mozilla).




 kernel/sched.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff -puN kernel/sched.c~o5int-2 kernel/sched.c
--- 25/kernel/sched.c~o5int-2	2003-07-25 20:09:06.000000000 -0700
+++ 25-akpm/kernel/sched.c	2003-07-25 20:09:08.000000000 -0700
@@ -1274,11 +1274,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--;
@@ -1311,6 +1307,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);

_