From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 17 10:09:29 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE98816A4CE for ; Wed, 17 Dec 2003 10:09:29 -0800 (PST) Received: from mail.codefusionis.com (ns.codefusionis.com [208.33.29.188]) by mx1.FreeBSD.org (Postfix) with SMTP id 5DD2E43D36 for ; Wed, 17 Dec 2003 10:08:56 -0800 (PST) (envelope-from tedu@zeitbombe.org) Received: (qmail 7476 invoked by uid 1049); 17 Dec 2003 18:09:18 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 17 Dec 2003 18:09:18 -0000 Date: Wed, 17 Dec 2003 13:09:18 -0500 (EST) From: Ted Unangst X-X-Sender: tedu@ns.codefusionis.com Cc: freebsd-hackers@freebsd.org In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: patch: portable dirhash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2003 18:09:29 -0000 while on the subject, there's a piece of code something like this in freebsd: /* * We hash the name and then some other bit of data that is * invariant over the dirhash's lifetime. Otherwise names * differing only in the last byte are placed close to one * another in the table, which is bad for linear probing. */ hash = hash32_buf(name, namelen, HASHINIT); hash = hash32_buf(dh, sizeof(dh), hash); which isn't doing what you'd expect (hashing the dh pointer), instead it hashes the first bytes of dh, conveniently a constant value so it works, but it provides no benefit. fix is making it &dh. i'd provide a diff, but it's a little large. :) -- all we're waiting for is for something worth waiting for