Axel Dörfler wrote: > Ingo Weinhold <ingo_weinhold@xxxxxx> wrote: > > On 2011-05-31 at 09:30:21 [+0200], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> > > > wrote: > I'm pretty sure that GCC2 also inlined static functions automatically > with optimizations turned on. Maybe with -O3 (which we don't use) or in different circumstances. At least here I can see three non-inlined context_switch() functions in my gcc 2 built release kernel. > One additional feature of GCC4, however, > is to be able to inline methods over the bounds of an object file IIRC. You mean the linker inlines already compiled functions into others? I somewhat doubt that. I believe LLVM does this kind of optimization, but not with actual machine code. > > > which might make a measurable > > > difference, > > The overhead for the call is relatively small compared to what is > > done when > > switching the thread and even smaller with respect to the whole > > *_reschedule() function. So, unless you measure the *_reschedule() > > itself, I > > seriously doubt that there is a measurable difference. > > Which contradicts itself - if there is a measurable difference in > *_reschedule(), there will also be one when the scope gets larger :-) No, that isn't generally true. Measurements can only be done with a certain accuracy. Say, the change makes *_reschedule() 1% slower and the function itself eats 1% CPU time under heavy load, the total effect of the change would be 0.01%. I'm pretty sure this is not practically measurable. CU, Ingo