diff options
author | NeilBrown <neilb@suse.de> | 2014-06-04 17:39:26 +1000 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-06-17 16:42:47 -0400 |
commit | 6282cd56555347c0ec2addc97bd96b40df0a38b7 (patch) | |
tree | 53b6573954b79471cc35ad36640320eb7c9eaa88 /Documentation/EDID | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) | |
download | op-kernel-dev-6282cd56555347c0ec2addc97bd96b40df0a38b7.zip op-kernel-dev-6282cd56555347c0ec2addc97bd96b40df0a38b7.tar.gz |
NFSD: Don't hand out delegations for 30 seconds after recalling them.
If nfsd needs to recall a delegation for some reason it implies that there is
contention on the file, so further delegations should not be handed out.
The current code fails to do so, and the result is effectively a
live-lock under some workloads: a client attempting a conflicting
operation on a read-delegated file receives NFS4ERR_DELAY and retries
the operation, but by the time it retries the server may already have
given out another delegation.
We could simply avoid delegations for (say) 30 seconds after any recall, but
this is probably too heavy handed.
We could keep a list of inodes (or inode numbers or filehandles) for recalled
delegations, but that requires memory allocation and searching.
The approach taken here is to use a bloom filter to record the filehandles
which are currently blocked from delegation, and to accept the cost of a few
false positives.
We have 2 bloom filters, each of which is valid for 30 seconds. When a
delegation is recalled the filehandle is added to one filter and will remain
disabled for between 30 and 60 seconds.
We keep a count of the number of filehandles that have been added, so when
that count is zero we can bypass all other tests.
The bloom filters have 256 bits and 3 hash functions. This should allow a
couple of dozen blocked filehandles with minimal false positives. If many
more filehandles are all blocked at once, behaviour will degrade towards
rejecting all delegations for between 30 and 60 seconds, then resetting and
allowing new delegations.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'Documentation/EDID')
0 files changed, 0 insertions, 0 deletions