Subject: Re: [RFC] [PATCH] udp: optimize lookup of UDP sockets to by including destination address in the hash key

From: Andi Kleen <[email-masked]>
Date: Thu, 5 Nov 2009 15:54:28 +0100

> I assume cache is cold or even on other cpu (worst case), dealing with
> 100.000+ sockets or so...

Other CPU cache hit is actually typically significantly 
faster than a DRAM access (unless you're talking about a very large NUMA 
system and a remote CPU far away)
> 
> If workload fits in one CPU cache/registers, we dont mind taking one
> or two cache lines per object, obviously.

It's more like part of your workload needs to fit.

For example if you use a tree and the higher levels fit into
the cache, having a few levels in the tree is (approximately) free.

That's why I'm not always fond of large hash tables. They pretty
much guarantee a lot of cache misses under high load, because
they have little locality.

-Andi
-- 
[email-masked] -- Speaking for myself only.