Messages in this thread | | | Date | Wed, 22 Apr 2009 08:07:01 +0200 | From | Andi Kleen <> | Subject | Re: [PATCH 2/8] tracing: create automated trace defines |
| |
> I think it was Ingo that let out the idea, and I'm starting to like it. > > Perhaps we should fork off gcc and ship Linux with its own compiler. This > way we can optimize it for the kernel and not worry about any userland > optimizations. > > I would like to do something like: > > if (unlikely(err)) { > __section__(".error_sect") {
gcc already supports that, you don't need to fork anything. It's called hot/cold partitioning. Basically it splits functions into hot and cold and unlikely parts and all the cold/unlikely parts go into a separate sections.
I think it's normally not enabled by default on x86 though, probably because it doesn't help too much.
By default (unless you specify -fno-reorder-blocks) it does the same without sections, just moving unlikely code out of line.
-Andi -- ak@linux.intel.com -- Speaking for myself only.
| |