Re: [PATCH 00/16] Remove the ipv4 routing cache
From: Eric Dumazet <hidden>
Date: 2012-07-27 16:28:58
On Fri, 2012-07-27 at 09:23 -0700, Eric W. Biederman wrote:
I am familiar. But does hardware prefetching make a difference if your object is less than 64 bytes?
Apparently yes, if the prefetch touches a dirtied neighbour cache line.
I don't believe only allocating 64 bytes will be a problem, as no one else well be dirtying your cache line. I suppose you could run into pathologies where your object is 3*64 bytes in size, but your expression doesn't handle that case either.
Sure, but in most cases fib objects are under 128 bytes.
The other alternative to guarantee very good cache behavior is to ensure you are allocating a power of two size up to some limit, perhaps page size.
Good idea.
My point is the magic 128 likely requires an explicatory comment and I think the net result is you have encoded something fragile that is good for testing but that will in the fullness of time do strange things that will be easy to overlook.
Sure, I'll send a v2, thanks.