nfsd: keep stats on worst hash balancing seen so far
authorJeff Layton <jlayton@redhat.com>
Wed, 27 Mar 2013 14:15:39 +0000 (10:15 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 3 Apr 2013 15:47:25 +0000 (11:47 -0400)
commit98d821bda189ba2bfcb3877ea3064da3403698ae
treec369d29f8c0599830f900049eb6ed49b9f9ccfc7
parenta2f999a37ebb77e857d3a178bd6f52d1163cd980
nfsd: keep stats on worst hash balancing seen so far

The typical case with the DRC is a cache miss, so if we keep track of
the max number of entries that we've ever walked over in a search, then
we should have a reasonable estimate of the longest hash chain that
we've ever seen.

With that, we'll also keep track of the total size of the cache when we
see the longest chain. In the case of a tie, we prefer to track the
smallest total cache size in order to properly gauge the worst-case
ratio of max vs. avg chain length.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfscache.c