diff options
author | Jeff Layton <jlayton@redhat.com> | 2013-03-27 10:15:39 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-04-03 11:47:25 -0400 |
commit | 0733c7ba1ef0d7e29a11c52f4d1356fc394de334 (patch) | |
tree | 41fa9ac7a46d1f9d02286fffca90e333020997e3 /fs/nfsd/lockd.c | |
parent | 98d821bda189ba2bfcb3877ea3064da3403698ae (diff) | |
download | linux-0733c7ba1ef0d7e29a11c52f4d1356fc394de334.tar.bz2 |
nfsd: scale up the number of DRC hash buckets with cache size
We've now increased the size of the duplicate reply cache by quite a
bit, but the number of hash buckets has not changed. So, we've gone from
an average hash chain length of 16 in the old code to 4096 when the
cache is its largest. Change the code to scale out the number of buckets
with the max size of the cache.
At the same time, we also need to fix the hash function since the
existing one isn't really suitable when there are more than 256 buckets.
Move instead to use the stock hash_32 function for this. Testing on a
machine that had 2048 buckets showed that this gave a smaller
longest:average ratio than the existing hash function:
The formula here is longest hash bucket searched divided by average
number of entries per bucket at the time that we saw that longest
bucket:
old hash: 68/(39258/2048) == 3.547404
hash_32: 45/(33773/2048) == 2.728807
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/lockd.c')
0 files changed, 0 insertions, 0 deletions