Skip to contentSkip to conversation

Tell GCC 4.1 to move unlikely() code to a separate section

PATCH Chuck Ebbert 1 participant 1 message Feb 28, 2006

lore
Share & tools
lore
#0 lore raw

In-Reply-To: <[email protected]>

Quoted 11 lines · Andi Kleen
Quoted 5 lines · Arjan van de Ven

This patch is more controversial I assume; it offers the option to use the gcc 4.1 option to move unlikely() code to a separate section. On the con side, this means that longer byte sequences are needed to jump to this code, on the Pro side it means that the unlikely() code isn't sharing icache cachelines and tlbs anymore.

I don't think this will do anything because the default Makefile still has

CFLAGS += -fno-reorder-blocks

This also won't work for functions that specify an explicit section name, e.g. __sched, __kprobes etc. -- at least that's what the gcc 4.0.2 docs say.

Signature · 2 lines
Chuck
"Equations are the Devil's sentences."  --Stephen Colbert