From 05d2b90d5571c51ea2cbe9213164f95dce6b829d Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 19 May 2004 02:36:00 -0700 Subject: [PATCH] [PATCH] Work around gcc 3.3.3-hammer sched miscompilation on x86-64 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. --- kernel/sched.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/sched.c b/kernel/sched.c index 58f8745221791..7e1f705970263 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1662,8 +1662,11 @@ static runqueue_t *find_busiest_queue(struct sched_group *group) * 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; -- 2.53.0