From owner-freebsd-hackers Sat Mar 1 09:02:22 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id JAA18110 for hackers-outgoing; Sat, 1 Mar 1997 09:02:22 -0800 (PST) Received: from root.com (implode.root.com [198.145.90.17]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA18104 for ; Sat, 1 Mar 1997 09:02:19 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by root.com (8.8.5/8.6.5) with SMTP id JAA05291; Sat, 1 Mar 1997 09:03:20 -0800 (PST) Message-Id: <199703011703.JAA05291@root.com> X-Authentication-Warning: implode.root.com: localhost [127.0.0.1] didn't use HELO protocol To: "David S. Miller" cc: netdev@roxanne.nuclecu.unam.mx, hackers@freebsd.org Subject: Re: ok, final sockhash changes, new diff In-reply-to: Your message of "Sat, 01 Mar 1997 04:32:49 EST." <199703010932.EAA09015@jenolan.caipgeneral> From: David Greenman Reply-To: dg@root.com Date: Sat, 01 Mar 1997 09:03:20 -0800 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, David. I just looked at the hash algorithm you're using in tcp_hashfn()...I think it looks pretty good, and it's easy to see why it would have good distribution properties. I didn't think about using xor when I wrote the stuff for FreeBSD. :-( ...Anyway, I hope you don't mind if I change the algorithm in FreeBSD to use xor's. :-) It seems like the laddr/faddr would likely have a not-very-unique low order portion (since most hosts are assigned addresses in the low range of class A/B/C's), so it seems like this could perhaps be improved by combining the upper word of the IP address with the lower word...but perhaps this would be just extra overhead (since your analysis seems to show the distribution is already quite good). I've had other improvements to the FreeBSD code on my whiteboard since last summer ("DELACK queue", for example), but haven't had the time to work on implementing them. BTW, one thing I didn't see in your code that was suggested to me a few months ago (and is also on my whiteboard), is another queue to move connections that have closed and are just waiting for the 2MSL wait to expire. In the case of busy WWW servers, it's common for the majority of the connections to be in this state, so by moving them off of the regular hashed queue and on to a private hashed queue, you can speed up the lookups for the active connections. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project