All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Cohen <me@ohdarn.net>
To: Rik van Riel <riel@conectiva.com.br>
Cc: marcelo@conectiva.com.br, linux-kernel@vger.kernel.org
Subject: Re: Submssions for 2.4.19-pre [Fibonacci Hashing (William Lee Irwin)] [Discuss :) ]
Date: Mon, 25 Feb 2002 21:10:34 -0500	[thread overview]
Message-ID: <20020225211034.0de635cf.me@ohdarn.net> (raw)
In-Reply-To: <Pine.LNX.4.33L.0202252302080.7820-100000@imladris.surriel.com>
In-Reply-To: <20020225205604.0583595e.me@ohdarn.net> <Pine.LNX.4.33L.0202252302080.7820-100000@imladris.surriel.com>

On Mon, 25 Feb 2002 23:04:58 -0300 (BRT)
Rik van Riel <riel@conectiva.com.br> wrote:

> On Mon, 25 Feb 2002, Michael Cohen wrote:
> 
> > This one was given to me by WLI himself;
> 
> Are you sure these are the latest bit-sparse primes ?

WLI has yet to update me, and I've yet to see anything new from him in this area.  I could be mistaken.

> > +++ linux-patched/include/asm-alpha/param.h	Mon Feb 25 20:44:35 2002
> 
> > +/* SPARSE_GOLDEN_RATIO_PRIME ought to be different for non-32bit arches. */
> > +
> > +#ifndef SPARSE_GOLDEN_RATIO_PRIME
> > +#define SPARSE_GOLDEN_RATIO_PRIME 0x9e004001UL
> > +#endif
> 
> > +++ linux-patched/include/asm-arm/param.h	Mon Feb 25 20:43:13 2002
> > +#ifndef SPARSE_GOLDEN_RATIO_PRIME
> > +#define SPARSE_GOLDEN_RATIO_PRIME 0x9e004001UL
> > +#endif
> 
> Yuck, the fact that you're defining the exact same constant in
> many .h files is ugly.  Could you move this to one place ?
 
> (maybe linux/hash.h like Rusty is doing for 2.5?)

Possible.  Take a look at HZ though. It's an arch-specific parameter similar to HZ (different for some arches, but not all) and it looks like it belongs in params.h for that reason.
 
> > +	unsigned long hash;
> > +	hash   = (unsigned long) mapping + index;
> > +	hash  *= SPARSE_GOLDEN_RATIO_PRIME;
> > +	hash >>= BITS_PER_LONG - PAGE_HASH_BITS;
> > +	hash  &= PAGE_HASH_SIZE - 1;
> > +	return hash;
> 
> For 64-bit systems you'll want:
> 
> 1) a 64-bit golden ratio prime
> 2) expanding the bit ops by hand because gcc doesn't do
>    it for you
> These last 2 points are easy, you can just copy the stuff
> from the struct page patch I sent earlier.

Great, thanks :)

> cheers,
> 
> Rik
> -- 
> "Linux holds advantages over the single-vendor commercial OS"
>     -- Microsoft's "Competing with Linux" document
> 
> http://www.surriel.com/		http://distro.conectiva.com/

  reply	other threads:[~2002-02-26  2:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-26  1:56 Submssions for 2.4.19-pre [Fibonacci Hashing (William Lee Irwin)] [Discuss :) ] Michael Cohen
2002-02-26  2:04 ` Rik van Riel
2002-02-26  2:10   ` Michael Cohen [this message]
2002-02-26  2:22     ` William Lee Irwin III
  -- strict thread matches above, loose matches on Subject: below --
2002-02-26  1:54 Michael Cohen

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=20020225211034.0de635cf.me@ohdarn.net \
    --to=me@ohdarn.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=riel@conectiva.com.br \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.