Re: [patch 2/7] lib/hashmod: Add modulo based hash mechanism
From: Rik van Riel
Date: Fri Apr 29 2016 - 21:35:01 EST
On Fri, 2016-04-29 at 16:51 -0700, Linus Torvalds wrote:
> There's presumably a few optimal values from a "spread bits out
> evenly" standpoint, and they won't have anything to do with random
> irrational constants, and will have everything to do with having nice
> bitpatterns.
>
> I'm adding Rik to the cc, because the original broken constants came
> from him long long ago (they go back to 2002, originally only used
> for
> the waitqueue hashing. Maybe he had some other input that caused him
> to believe that the primeness actually mattered.
I do not remember where I got that hashing algorithm and
magic constant from 14 years ago, but the changelog suggests
I got it from Chuck Lever's paper.
Chuck Lever's paper does mention that primeness "adds
certain desirable qualities", and I may have read too
much into that.
I really do not remember the "bit sparse" thing at all,
and have no idea
where that came from. Googling old email
threads about the code mostly
makes me wonder "hey, where
did that person go?"
I am all for magic numbers that work better.
--
All Rights Reversed.
Attachment:
signature.asc
Description: This is a digitally signed message part