Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752919AbcD3Bez (ORCPT ); Fri, 29 Apr 2016 21:34:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36875 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751679AbcD3Bex (ORCPT ); Fri, 29 Apr 2016 21:34:53 -0400 Message-ID: <1461980088.13397.71.camel@redhat.com> Subject: Re: [patch 2/7] lib/hashmod: Add modulo based hash mechanism From: Rik van Riel To: Linus Torvalds , Thomas Gleixner Cc: LKML , Peter Zijlstra , Ingo Molnar , Andrew Morton , Sebastian Andrzej Siewior , Darren Hart , Michael Kerrisk , Davidlohr Bueso , Chris Mason , "Carlos O'Donell" , Torvald Riegel , Eric Dumazet Date: Fri, 29 Apr 2016 21:34:48 -0400 In-Reply-To: References: <20160428161742.363543816@linutronix.de> <20160428163525.495514517@linutronix.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-5ITt93aw2VBcOSD2HLqm" Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 30 Apr 2016 01:34:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1897 Lines: 57 --=-5ITt93aw2VBcOSD2HLqm Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. --=20 All Rights Reversed. --=-5ITt93aw2VBcOSD2HLqm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXJAu5AAoJEM553pKExN6DO0UIAKxi6opq6frQ2znjtvDdSNu8 Be5xy170eXflsy0d62F7q2A/yZN652QBME3TgZ3mFnar2Fmvy04+k/etGZ64nuLp sMKWggWk3rPT2lMPLuA3e2yD7TwxLrKYwxeovNqykb/hyNNs0ElEW7ubl7+7kRVo pP30QbRwjQqndbrD/SkmBhAwa6tLO2AwWaf+yMU6G/PIMySi4SOicCqD/c4dSlSl 38hGWZpo44tMB+Ch1MUSgrZ9olkDCoxunMicWOOXA7LevMdfVyzghOlEj0YHJsMi B/jxdCaeBXsxPrFp24rsOfpAADX2M8jgvoFJjQ1qi1fAI26FqPCwXoDU67WqR4E= =GzQA -----END PGP SIGNATURE----- --=-5ITt93aw2VBcOSD2HLqm--