On Mon, 25 Jun 2007, Adrian Bunk wrote:
On Sun, Jun 24, 2007 at 09:34:05PM -0400, Jeff Garzik wrote:Adrian Bunk wrote:The interesting questions are: Does -Os still sometimes generate faster code with gcc 4.2? If yes, why?Smaller code can mean fewer page faults, fewer cache invalidations, etc. It's not just a matter of compiler code generation, gotta look at the whole picture.
the picture gets even murkier when you consider that even if neither option overflows the cpu cache the one that takes more space in the cache leaves less space in the cache for the userspacde code that the system is actually there to run.
Sure, but my point is that if the kernel is considered special and the best optimization for the kernel is therefore between -Os and -O2, we should try to find this point of best optimization. This should address Arjans point that -Os might not be best choice for best performance (and it's actually our fault if gcc generates stupid but small code when we use -Os).
what can be done to find the horribly bad but small code among the "it's smaller and would be less efficiant if you didn't consider the cache" majority?
David Lang - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Oleg Verych <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: "rae l" <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Oleg Verych <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- -Os versus -O2
- From: Adrian Bunk <[email protected]>
- Re: -Os versus -O2
- From: Jeff Garzik <[email protected]>
- Re: -Os versus -O2
- From: Adrian Bunk <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- Prev by Date: Re: hsm violation
- Next by Date: [PATCH 2.6.22-rc5] libata: add HTS541616J9SA00 to NCQ blacklist
- Previous by thread: Re: -Os versus -O2
- Next by thread: ARC-1260: No space left on device, when there is (or should be) free space left
- Index(es):