[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 4/5] libxfs: buffer cache hashing is suboptimal
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Fri, 13 Dec 2013 09:23:31 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20131212205657.GA10988@dastard>
References: <1386832945-19763-1-git-send-email-david@xxxxxxxxxxxxx> <1386832945-19763-5-git-send-email-david@xxxxxxxxxxxxx> <52AA078E.90800@xxxxxxxxxx> <20131212205657.GA10988@dastard>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
On 12/12/2013 03:56 PM, Dave Chinner wrote:
> 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.

Ah.. xfs_bufkey->blkno is an xfs_daddr_t, which is an __int64_t. Thanks.

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

> Cheers,
> Dave.

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