[patch 1/2] fix perf. bug in wake-up load balancing for aim7 and db workload

From: Chen, Kenneth W
Date: Mon Feb 13 2006 - 22:10:44 EST


Revert commit d7102e95b7b9c00277562c29aad421d2d521c5f6,
which causes more than 10% performance regression with aim7.


Signed-off-by: Ken Chen <kenneth.w.chen@xxxxxxxxx>

--- linux-2.6.16-rc2/include/linux/sched.h.orig 2006-02-13 18:15:09.660276655 -0800
+++ linux-2.6.16-rc2/include/linux/sched.h 2006-02-13 18:15:36.234495079 -0800
@@ -697,12 +697,9 @@ struct task_struct {

int lock_depth; /* BKL lock depth */

-#if defined(CONFIG_SMP)
- int last_waker_cpu; /* CPU that last woke this task up */
-#if defined(__ARCH_WANT_UNLOCKED_CTXSW)
+#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
int oncpu;
#endif
-#endif
int prio, static_prio;
struct list_head run_list;
prio_array_t *array;
--- linux-2.6.16-rc2/kernel/sched.c.orig 2006-02-13 18:11:28.946412171 -0800
+++ linux-2.6.16-rc2/kernel/sched.c 2006-02-13 18:14:29.595824020 -0800
@@ -1294,9 +1294,6 @@ static int try_to_wake_up(task_t *p, uns
}
}

- if (p->last_waker_cpu != this_cpu)
- goto out_set_cpu;
-
if (unlikely(!cpu_isset(this_cpu, p->cpus_allowed)))
goto out_set_cpu;

@@ -1367,8 +1364,6 @@ out_set_cpu:
cpu = task_cpu(p);
}

- p->last_waker_cpu = this_cpu;
-
out_activate:
#endif /* CONFIG_SMP */
if (old_state == TASK_UNINTERRUPTIBLE) {
@@ -1450,12 +1445,9 @@ void fastcall sched_fork(task_t *p, int
#ifdef CONFIG_SCHEDSTATS
memset(&p->sched_info, 0, sizeof(p->sched_info));
#endif
-#if defined(CONFIG_SMP)
- p->last_waker_cpu = cpu;
-#if defined(__ARCH_WANT_UNLOCKED_CTXSW)
+#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
p->oncpu = 0;
#endif
-#endif
#ifdef CONFIG_PREEMPT
/* Want to start with kernel preemption disabled. */
task_thread_info(p)->preempt_count = 1;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/