Re: [patch] i386: use C code for current_thread_info()

From: Chuck Ebbert
Date: Mon Jun 12 2006 - 13:18:44 EST


In-Reply-To: <448C85B7.1010902@xxxxxxxx>

On Sun, 11 Jun 2006 23:05:59 +0200, Emmanuel Fleury wrote:

> > Looking at the generated code, it seems the compiler just makes dumb
> > choices and tends to recompute current_thread_info() in unlikely code
> > paths even when there is no register pressure. 4.0.2 makes better
> > choices.
>
> What size with gcc 4.1.2 ? (just curiosity)

The 3.3 vs 4.0 comparisons were with two different configs, so only
relative gain/loss with asm vs. C could be compared.

I downloaded gcc 4.1.1 and compared to 4.0.2 with the exact same config,
since I was curious how much better it might be overall.

gcc 4.0.2:
text data bss dec hex filename
3645212 555556 312024 4512792 44dc18 2.6.17-rc6-nb-C/vmlinux
3647276 555556 312024 4514856 44e428 2.6.17-rc6-nb-asm/vmlinux
-2064

gcc 4.1.1:
text data bss dec hex filename
3614686 520416 311672 4446774 43da36 2.6.17-rc6-nb-C/vmlinux
3616942 520416 311672 4449030 43e306 2.6.17-rc6-nb-asm/vmlinux
-2256

Kernel code starts out ~30K bytes smaller with gcc 4.1 and using C
for current_thread_info() helps even more than with 4.0. Nice...

Maybe a patch that enables C code for gcc 4.0+ would work, since
on 3.3 the asm code is better?

--
Chuck
-
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/