From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org, riel@surriel.com, mjc@kernel.org,
bcrl@redhat.com, akpm@zip.com.au, phillips@bonn-fries.net
Subject: Re: hashed waitqueues
Date: Tue, 8 Jan 2002 10:20:37 -0800 [thread overview]
Message-ID: <20020108102037.J10391@holomorphy.com> (raw)
In-Reply-To: <20020104094049.A10326@holomorphy.com> <E16MeqE-0001Ea-00@starship.berlin> <20020104173923.B10391@holomorphy.com> <E16Mgoj-0001Ew-00@starship.berlin> <20020104210611.C10391@holomorphy.com>
In-Reply-To: <20020104210611.C10391@holomorphy.com>; from wli@holomorphy.com on Fri, Jan 04, 2002 at 09:06:11PM -0800
On January 5, 2002 02:39 am, William Lee Irwin III wrote:
>>> 2 or 3 shift/adds is really not possible, the population counts of the
>>> primes in those ranges tends to be high, much to my chagrin.
On Sat, Jan 05, 2002 at 03:44:06AM +0100, Daniel Phillips wrote:
>> It doesn't really have to be a prime, being relatively prime is also
>> good, i.e., not too many or too small factors. Surely there's a multiplier
>> in the right range with just two prime factors that can be computed with 3
>> shift-adds.
The (theoretically) best 64-bit prime with 5 high bits I found is:
11673330234145374209 == 0xa200000000100001
which has continued fraction of p/2^64
= 0,1,1,1,2,1,1,1,1,1,1,1073740799,2,1,1,1,1,6,1,1,5,1023,1,4,1,1,3,3
and the (theoretically) best 64-bit prime with 4 high bits I found is:
11529215046068994049 == 0xa000000000080001
which has continued fraction of p/2^64
= 0,1,1,1,2,549754765313,1,1,1,1,1,4095,2,1,1,1,1,2,1,2
(the continued fractions terminate after the points given here)
Which of the two would be better should depend on whether the penalty
against the distribution for the sixth term of the 4-bit prime is worse
than the computational expense of the extra shift/add for the 5-bit prime.
I need to start benching this stuff.
Cheers,
Bill
next prev parent reply other threads:[~2002-01-08 18:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-04 17:40 hashed waitqueues William Lee Irwin III
2002-01-04 21:47 ` Momchil Velikov
2002-01-04 23:07 ` Andrew Morton
2002-01-04 23:21 ` Andrew Morton
2002-01-04 23:48 ` William Lee Irwin III
2002-01-05 0:37 ` Daniel Phillips
2002-01-05 1:39 ` William Lee Irwin III
2002-01-05 2:44 ` Daniel Phillips
2002-01-05 5:06 ` William Lee Irwin III
2002-01-08 18:20 ` William Lee Irwin III [this message]
2002-01-08 18:27 ` William Lee Irwin III
[not found] ` <523d1gu1ni.fsf@love-boat.topspincom.com>
2002-01-08 18:44 ` William Lee Irwin III
2002-01-08 19:20 ` Hugh Dickins
2002-01-08 20:19 ` William Lee Irwin III
2002-01-16 14:21 ` Jamie Lokier
2002-01-16 17:42 ` William Lee Irwin III
2002-01-18 0:34 ` Jamie Lokier
2002-01-06 21:09 ` Rik van Riel
-- strict thread matches above, loose matches on Subject: below --
2002-01-04 21:17 Ed Tomlinson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020108102037.J10391@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@zip.com.au \
--cc=bcrl@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjc@kernel.org \
--cc=phillips@bonn-fries.net \
--cc=riel@surriel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox