Re: more on hash functions

Paul F. Dietz (dietz@interaccess.com)
Wed, 14 Apr 1999 21:06:53 -0500


Chuck Lever wrote:

> my random tables were constructed such that, for a 256 entry random table,
> the table contained unique random values from 0 to 255. making these 16
> bit numbers would only add some hash tablesize flexibility, but i don't
> believe it would help the hash function generate better randomness.

If the hash table itself has more than 256 entries, then it
would certainly produce better randomness. The small random
table entries would mean you are only hashing to the low
end of the hash table.

In Linux x86, the size of the hash table is 2048 (1 << PAGE_HASH_BITS),
so your hash function, as implemented, would be very bad.

Paul

-
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/