Skip to contentSkip to conversation

function ordering (was: Re: [RFC] exit_thread() speedups in x86

DISCUSSION Dan Kegel 1 participant 1 message Jul 4, 2005

lore
Share & tools
lore

Dan Kegel

author
#0 lore raw
Quoted 8 lines · Arjan van de Ven

hmm. I wonder if a slightly different approach (based on the __slow) idea would make sense
1) Use -ffunction-sections option from gcc to put each function in it's own section
2) Use readprofile/oprofile data to collect an (external to the code) list of hot/cold functions (we can put a default list in the kernel source somewhere and allow people to measure their own if they want)
3) Use this list to make a linker script to order the functions

Somebody recently implemented something similar; see
http://www.bclennox.com/ldreorder/
It used valgrind rather than oprofile.
- Dan

Signature · 1 line
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html