> On Tue, March 20, 2012 13:59, Eric Dumazet wrote: > > On Tue, 2012-03-20 at 13:24 +1100, Indan Zupancic wrote: > > > >> If it does then perhaps the fast path should be made faster by inlining > >> the code instead of calling a function which may not be cached. > >> > > > > inlining 400 times a sequence of code is waste of icache you probably > > missed this. > > Well, according to you most filters were small, inling 26 bytes a few > times should be faster than calling an external function. Not > all calls need to be inlined either. I wouldn't bet on it. If the number of arguments is small enough to fit in the registers, the called function doesn't to save any registers, and the call doesn't mean the calling code runs out of registers, the actual cost of the call will be minimal. OTOH the benefit of only having to fetch the code once, and the higher likelyhood that it will be in the i-cache from some other use, will make the version with the calls faster. You need to do real benchmarks on a real system running a real workload to find out which is better. Oh and beware that changes in which code shares cache lines can have a measuarable effect (typified by unrelated changes affecting measured performance). David -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html