RE: [PATCH] net: bpf_jit: Simplify code by always using offset8 or offset32.

From
David Laight <hidden>
Date
2012-03-20 11:43:15
Also in
linux-arch, lkml
Reply to
Indan Zupancic, 2012-03-20
 
On Tue, March 20, 2012 13:59, Eric Dumazet wrote:
quoted
On Tue, 2012-03-20 at 13:24 +1100, Indan Zupancic wrote:
quoted
If it does then perhaps the fast path should be made faster by
inlining
quoted
quoted
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
quoted
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

Thread (40 messages) 40 messages, 5 authors, last reply 2012-03-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help