[PATCH 4/5] libxfs: buffer cache hashing is suboptimal
Dave Chinner
david at fromorbit.com
Thu Dec 12 14:56:57 CST 2013
On Thu, Dec 12, 2013 at 01:59:26PM -0500, Brian Foster wrote:
> On 12/12/2013 02:22 AM, Dave Chinner wrote:
> > From: Dave Chinner <dchinner at redhat.com>
> >
> > The hashkey calculation is very simplistic,and throws away an amount
> > of entropy that should be folded into the hash. The result is
> > sub-optimal distribution across the hash tables. For example, with a
> > default 512 entry table, phase 2 results in this:
> >
> ...
> > Modify the hash to be something more workable - steal the linux
> > kernel inode hash calculation and try that:
> >
> ...
> >
> > Kinda says it all, really...
> >
> > Signed-off-by: Dave Chinner <dchinner at redhat.com>
> > ---
>
> Results look nice and the algorithm seems to match the kernel variant,
> but what about the 32-bit alternate prime/cache line values? Safe to
> leave out..?
The buffer cache uses a 64 bit key, regardless of the platform.
Therefore the 64 bit variant is always needed. The kernel inode hash
uses a 32 bit key on 32 bit systems, which is why there are two
variants for it.
Cheers,
Dave.
--
Dave Chinner
david at fromorbit.com
More information about the xfs
mailing list