From: Andi Kleen The new domain scheduler got miscompiled on x86-64 with gcc 3.3.3-hammer, which is shipping with some distributions. The kernel deadlocks eventually under light stress on SMP systems with the right options. After some experiments it seems this simple change avoids the miscompilation. It also doesn't pessimize the code unduly for other architectures. --- 25-akpm/kernel/sched.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) diff -puN kernel/sched.c~work-around-gcc-333-hammer-sched-miscompilation-on-x86-64 kernel/sched.c --- 25/kernel/sched.c~work-around-gcc-333-hammer-sched-miscompilation-on-x86-64 2004-05-15 23:53:50.216019952 -0700 +++ 25-akpm/kernel/sched.c 2004-05-15 23:53:50.222019040 -0700 @@ -1804,8 +1804,11 @@ static runqueue_t *find_busiest_queue(st * tasks if there is an imbalance. * * Called with this_rq unlocked. + * + * This function is marked noinline to work around a compiler + * bug with gcc 3.3.3-hammer on x86-64. */ -static int load_balance(int this_cpu, runqueue_t *this_rq, +static int noinline load_balance(int this_cpu, runqueue_t *this_rq, struct sched_domain *sd, enum idle_type idle) { struct sched_group *group; _