xfs
[Top] [All Lists]

Re: [PATCH 4/5] libxfs: buffer cache hashing is suboptimal

To: Brian Foster <bfoster@xxxxxxxxxx>
Subject: Re: [PATCH 4/5] libxfs: buffer cache hashing is suboptimal
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 13 Dec 2013 07:56:57 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <52AA078E.90800@xxxxxxxxxx>
References: <1386832945-19763-1-git-send-email-david@xxxxxxxxxxxxx> <1386832945-19763-5-git-send-email-david@xxxxxxxxxxxxx> <52AA078E.90800@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
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@xxxxxxxxxx>
> > 
> > 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@xxxxxxxxxx>
> > ---
> 
> 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@xxxxxxxxxxxxx

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