Re: [2.6 patch] offer CC_OPTIMIZE_FOR_SIZE only if EXPERIMENTAL

From: David S. Miller
Date: Thu Dec 15 2005 - 01:53:27 EST


From: Linus Torvalds <torvalds@xxxxxxxx>
Date: Wed, 14 Dec 2005 15:32:28 -0800 (PST)

> Of course, the really right thing would be to chase down what goes
> wrong with -Os.

It turns out to be a sparc64 bug, technically, in my case.

What happens is that with -Os gcc _INLINES_ schedule() into
wait_for_completion(). No that's not a typo, when optimizing
for space it inlines a huge function like schedule() whereas
without -Os it does not. :-/

Anyways, switch_to() in sparc64 (and sparc) does not work properly
when this happens. schedule() needs to execute in it's own stack
frame for the stack switching in switch_to() to work.

Would anyone be against adding "noinline" to kernel/sched.c:schedule()?
I'm about to test that, but I'm extremely positive that it makes the
problem go away.
-
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/