lkml.org 
[lkml]   [1999]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Hash functions (was Re: 2.2.6_andrea2.bz2)
On Sun, 9 May 1999, Peter Steiner wrote:

>Andrea, may I reorder your questions?

Sure you're welcome ;).

>>And what is `hash'? The input of the hashfn of buffers are blocks and dev.
>
>Chuck tuned various hash functions, and only the buffer cache uses
>blocks and dev. hash is a generic substitution. In my description I
>used 'k' up to this point.

Ah ok. Fine. (I thought you was talking specifically about the buffer
hash)

>Since my hash table size is 16384 and thus (32 - HASH_BITS) = 18 the
>'normalized' hashfn is:
>
> i = ((k * 2654435761UL) >> 11) & bh_hash_mask
> = ((k * 2654435761UL) << ((32 - HASH_BITS) - 11)) >> (32 - HASH_BITS)

I don't think the above is correct. If you don't shift left for (32 -
HASH_BITS) at least at once, then you may have still some bit set to 1 in
the high part of `i'.

Andrea Arcangeli


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.045 / U:1.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site