On Tue, Mar 27, 2007 at 04:23:49PM +0200, Andi Kleen ([EMAIL PROTECTED]) wrote: > > 2) An extra list insert/delete to give list of all sockets > > That is currently limited by readlock on the hash buckets. I suspect > any change to a trie with less atomic operations will make it faster.
The best case for trie is to attach a bitmask of used/free slots per each trie node since it is based on arrays, so that list is not needed at all. I thought about additional list of all sockets just because I decided to not drop one of the hlist_node from sock_common, so it could be reused for other purposes. That hlist node is used for netlink broadcasting, but netlink case can be solved by moving sk_bind_node into private area and drop additional 8/16 bytes from socket structure. Trie nodes are protected through RCU, so it is possible to count not-yet-freed socket as long as miss just-added ones. I do not think this information can contain anyhow correct information, since we have essentially the same problem with hash bucket locks - until bucket is locked, we can not count for just-to-be-added sockets and count those ones which will be dropped just after lock is released in case removing function spins/waits for that bucket. > -Andi -- Evgeniy Polyakov - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html