Index: linux-2.6.10-ck7/kernel/sched.c
===================================================================
--- linux-2.6.10-ck7.orig/kernel/sched.c	2005-03-01 21:38:48.000000000 +1100
+++ linux-2.6.10-ck7/kernel/sched.c	2005-03-01 21:38:48.000000000 +1100
@@ -124,8 +124,8 @@ struct runqueue {
 	unsigned int cache_ticks, preempted;
 	task_t *curr, *idle;
 	struct mm_struct *prev_mm;
-	unsigned long bitmap[BITS_TO_LONGS(MAX_PRIO+1)];
-	struct list_head queue[MAX_PRIO + 1];
+	unsigned long bitmap[BITS_TO_LONGS(MAX_PRIO + 1)];
+	struct list_head queue[MAX_PRIO];
 	atomic_t nr_iowait;
 
 #ifdef CONFIG_SMP
@@ -658,8 +658,11 @@ static void continue_slice(task_t *p)
 static inline void recalc_task_prio(task_t *p, unsigned long long now,
 	unsigned long rq_load)
 {
-	unsigned long sleep_time = ns_diff(now, p->timestamp) /
-		(rq_load + 1);
+	unsigned long sleep_time;
+	if (rq_load > 31)
+		rq_load = 31;
+	sleep_time = ns_diff(now, p->timestamp) /
+		(1 << rq_load);
 
 	p->totalrun += p->runtime;
 	if (NS_TO_JIFFIES(p->totalrun) >= p->slice &&
@@ -1169,7 +1172,7 @@ void fastcall wake_up_new_task(task_t * 
 
 	if (likely(cpu == this_cpu)) {
 		current->flags |= PF_FORKED;
-		__activate_task(p, rq);
+		activate_task(p, rq, 1);
 		/*
 		 * We skip the following code due to cpu == this_cpu
 	 	 *
@@ -1186,7 +1189,7 @@ void fastcall wake_up_new_task(task_t * 
 		 */
 		p->timestamp = (p->timestamp - this_rq->timestamp_last_tick)
 					+ rq->timestamp_last_tick;
-		__activate_task(p, rq);
+		activate_task(p, rq, 0);
 		preempt(p, rq);
 
 		schedstat_inc(rq, wunt_moved);
@@ -4487,9 +4490,9 @@ void __init sched_init(void)
 		cache_delay = cache_decay_ticks * 5;
 #endif
 		atomic_set(&rq->nr_iowait, 0);
-		for (j = 0; j <= MAX_PRIO; j++)
+		for (j = 0; j < MAX_PRIO; j++)
 			INIT_LIST_HEAD(&rq->queue[j]);
-		memset(rq->bitmap, 0, BITS_TO_LONGS(MAX_PRIO+1)*sizeof(long));
+		memset(rq->bitmap, 0, BITS_TO_LONGS(MAX_PRIO)*sizeof(long));
 		/*
 		 * delimiter for bitsearch
 		 */
@@ -4509,14 +4512,6 @@ void __init sched_init(void)
 	 * when this runqueue becomes "idle".
 	 */
 	init_idle(current, smp_processor_id());
-
-#ifdef CONFIG_SMP
-	/*
-	 * We are now the idle thread so we need to do some magic to boot
-	 * on SMP.
-	 */
-	current->prio = MAX_PRIO - 2;
-#endif
 }
 
 #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP

