From: Con Kolivas <kernel@kolivas.org>

The OSDL robot monkeys revealed a massive reproducible regression in the
dbt3-pgsql benchmark which could be related to MBligh's measure regression.

With a little bit of detective work and help from Wli we tracked down that
this patch caused it:

[PATCH] sched: improve wakeup-affinity

A massive increase in idle time was observed and the throughput dropped by
40%.  It may be best to reverse this patch until the regression is
better understood.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/kernel/sched.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN kernel/sched.c~revert-sched-improve-wakeup-affinity kernel/sched.c
--- 25/kernel/sched.c~revert-sched-improve-wakeup-affinity	2004-06-11 18:10:35.984129984 -0700
+++ 25-akpm/kernel/sched.c	2004-06-11 18:10:35.997128008 -0700
@@ -892,8 +892,7 @@ static int try_to_wake_up(task_t * p, un
 		this_load -= SCHED_LOAD_SCALE;
 
 	/* Don't pull the task off an idle CPU to a busy one */
-	if (load < SCHED_LOAD_SCALE && load + this_load > SCHED_LOAD_SCALE
-			&& this_load > load)
+	if (load < SCHED_LOAD_SCALE/2 && this_load > SCHED_LOAD_SCALE/2)
 		goto out_set_cpu;
 
 	new_cpu = this_cpu; /* Wake to this CPU if we can */
@@ -1775,7 +1774,8 @@ nextgroup:
 	return busiest;
 
 out_balanced:
-	if (busiest && idle != NOT_IDLE && max_load > SCHED_LOAD_SCALE) {
+	if (busiest && (idle == NEWLY_IDLE ||
+			(idle == IDLE && max_load > SCHED_LOAD_SCALE)) ) {
 		*imbalance = 1;
 		return busiest;
 	}
_