The priority biasing was off by mutliplying the total load by the total priority bias and this ruins the ratio of loads between runqueues. This patch should correct the ratios of loads between runqueues to be proportional to overall load. -2nd attempt. Signed-off-by: Con Kolivas Index: linux-2.6.12-rc6-mm1/kernel/sched.c =================================================================== --- linux-2.6.12-rc6-mm1.orig/kernel/sched.c 2005-06-10 23:56:56.000000000 +1000 +++ linux-2.6.12-rc6-mm1/kernel/sched.c 2005-06-11 09:55:56.000000000 +1000 @@ -978,7 +978,8 @@ static inline unsigned long __source_loa else source_load = min(cpu_load, load_now); - if (idle == NOT_IDLE || rq->nr_running > 1) + if (idle == NOT_IDLE || rq->nr_running > 1) { + unsigned long prio_bias = 1; /* * If we are busy rebalancing the load is biased by * priority to create 'nice' support across cpus. When @@ -987,7 +988,10 @@ static inline unsigned long __source_loa * prevent idle rebalance from trying to pull tasks from a * queue with only one running task. */ - source_load *= rq->prio_bias; + if (rq->nr_running) + prio_bias = rq->prio_bias / rq->nr_running; + source_load *= prio_bias; + } return source_load; } @@ -1011,8 +1015,13 @@ static inline unsigned long __target_loa else target_load = max(cpu_load, load_now); - if (idle == NOT_IDLE || rq->nr_running > 1) - target_load *= rq->prio_bias; + if (idle == NOT_IDLE || rq->nr_running > 1) { + unsigned long prio_bias = 1; + + if (rq->nr_running) + prio_bias = rq->prio_bias / rq->nr_running; + target_load *= prio_bias; + } return target_load; }