Re: more on hash functions

Andrea Arcangeli (andrea@e-mind.com)
Thu, 8 Apr 1999 00:46:17 +0200 (CEST)


On Wed, 7 Apr 1999, Chuck Lever wrote:

>Apr 7 16:55:27 pillbox kernel: Total pages in hash: 9664 total buckets:
>8192
>Apr 7 16:55:27 pillbox kernel: hash table histogram:
>Apr 7 16:55:27 pillbox kernel: size: 0 buckets: 2521 pages: 0
>Apr 7 16:55:27 pillbox kernel: size: 1 buckets: 2976 pages: 2976
>Apr 7 16:55:27 pillbox kernel: size: 2 buckets: 1732 pages: 3464
>Apr 7 16:55:27 pillbox kernel: size: 3 buckets: 691 pages: 2073
>Apr 7 16:55:27 pillbox kernel: size: 4 buckets: 215 pages: 860
>Apr 7 16:55:27 pillbox kernel: size: 5 buckets: 51 pages: 255
>Apr 7 16:55:27 pillbox kernel: size: 6 buckets: 6 pages: 36

Very good.

>Apr 7 16:55:27 pillbox kernel: hash table histogram:
>Apr 7 16:55:27 pillbox kernel: size: 0 buckets: 23539 buffers: 0
>Apr 7 16:55:27 pillbox kernel: size: 1 buckets: 6571 buffers: 6571
>Apr 7 16:55:27 pillbox kernel: size: 2 buckets: 1899 buffers: 3798
>Apr 7 16:55:27 pillbox kernel: size: 3 buckets: 559 buffers: 1677
>Apr 7 16:55:27 pillbox kernel: size: 4 buckets: 102 buffers: 408
>Apr 7 16:55:27 pillbox kernel: size: 5 buckets: 39 buffers: 195
>Apr 7 16:55:27 pillbox kernel: size: 6 buckets: 53 buffers: 318
>Apr 7 16:55:27 pillbox kernel: size: 7 buckets: 6 buffers: 42

Great compared to the previous buffer distribution!!

>i have a full-blown patch that replaces the inode, dentry, fib, buffer,
>uid, and pid hashes with the simple function listed above. in general, the
>system feels more responsive, and throughput appears the same or slightly
>better than an unpatched system. when i've finished testing the page hash
>stuff, i'll include that and post the full patch.

Well for things like icache where the number of entries is always fixed, a
fuzzy-hash is sure the better struct so I think your better hash function
(looks better looking your reports) will be always very useful.

>how it works:

Many thanks for the explanation. If I understood well, the distribution is
given by the random trucation done by the limited size of integer
registers... Looks a really clean way to me.

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/