From: William Lee Irwin III <wli@holomorphy.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: 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 12:19:53 -0800 [thread overview]
Message-ID: <20020108121953.L10391@holomorphy.com> (raw)
In-Reply-To: <20020108102037.J10391@holomorphy.com> <Pine.LNX.4.21.0201081906400.1683-100000@localhost.localdomain>
In-Reply-To: <Pine.LNX.4.21.0201081906400.1683-100000@localhost.localdomain>; from hugh@veritas.com on Tue, Jan 08, 2002 at 07:20:27PM +0000
On Tue, 8 Jan 2002, William Lee Irwin III wrote:
>> I need to start benching this stuff.
On Tue, Jan 08, 2002 at 07:20:27PM +0000, Hugh Dickins wrote:
> Why is all this sophistication needed for hashing pages to wait queues?
> I understand that you should avoid a stupid hash (such as one where all
> pages end up on the same wait queue), and I understand why a cache needs
> a well-chosen hash, and I understand why shift is preferred to multiply;
> but I don't get why so much discussion of the precise hash for choosing
> the wait queue of a page: aren't the waits rare, and the pages mostly
> well-distributed anyway?
All this "sophistication" boils down to a single number, perhaps a single
#define. I'd at least like to put some thought into it, at the very least
as due diligence. And also I want to be able to answer the question of
"Where did the number come from?"
It doesn't really require that much effort, either. The non-bitsparse
golden ratio prime was just looked up in Chuck Lever's paper, and the
criteria I'm using to determine potentially useful bitsparse factors
(aside from sparsity itself) are largely from Knuth, who (paraphrasing)
says the important characteristic is the first several terms in the
continued fraction expansion of p/w, where w is the wordsize.
And the sieving "algorithm" is just me asking a couple of people how
they'd do it, and the sieve took well under a minute to run, and maybe
5 or 10 minutes to write.
And if it doesn't matter to you, please remember anyway that when I
wrote my hash functions I did put some thought into it.
Thanks,
Bill
next prev parent reply other threads:[~2002-01-08 20:22 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
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 [this message]
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=20020108121953.L10391@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@zip.com.au \
--cc=bcrl@redhat.com \
--cc=hugh@veritas.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