xfs
[Top] [All Lists]

Re: TAKE - improve xfs metadata hashing

To: Steve Lord <lord@xxxxxxx>
Subject: Re: TAKE - improve xfs metadata hashing
From: Andi Kleen <ak@xxxxxxx>
Date: Fri, 14 Feb 2003 23:43:01 +0100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <200302142225.h1EMPKo22498@jen.americas.sgi.com>
References: <200302142225.h1EMPKo22498@jen.americas.sgi.com>
Sender: linux-xfs-bounce@xxxxxxxxxxx
> linux/fs/xfs/pagebuf/page_buf.c - 1.94
>       - base the number of hash buckets for xfs metadata on the amount of
>         memory in the system, and use the same hash algorithm as the 
>         regular buffer cache.

Hi,

I cannot review the change because it hasn't reached the public
CVS server yet. But in general I would be very careful with existing
hash functions in Linux. Lots of them are suffering from  the
"i don't use a prime modulo, but some cheap binary modulo" problem,
causing bad hashing, which is normally papered around with making the 
cache size resizing overly aggressive, guaranteeing slow cache misses
when the hash table is accessed.

e.g. 

Buffer-cache hash table entries: 65536 (order: 6, 262144 bytes)

That's far too big, definitely guaranteeing cache misses for most
bucket accesses even on an Itanium 2 ;)

Probably you're better off with a much smaller table and a better hash function
using primes.

-Andi


<Prev in Thread] Current Thread [Next in Thread>