]> git.karo-electronics.de Git - linux-beck.git/commit
nfsd: keep a checksum of the first 256 bytes of request
authorJeff Layton <jlayton@redhat.com>
Mon, 4 Feb 2013 16:57:27 +0000 (11:57 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 8 Feb 2013 21:02:26 +0000 (16:02 -0500)
commit01a7decf75930925322c5efc87af0b5e58eb8650
treecdd3420f451edc0568f4318b1d2338d491679068
parent4c190e2f913f038c9c91ee63b59cd037260ba353
nfsd: keep a checksum of the first 256 bytes of request

Now that we're allowing more DRC entries, it becomes a lot easier to hit
problems with XID collisions. In order to mitigate those, calculate a
checksum of up to the first 256 bytes of each request coming in and store
that in the cache entry, along with the total length of the request.

This initially used crc32, but Chuck Lever and Jim Rees pointed out that
crc32 is probably more heavyweight than we really need for generating
these checksums, and recommended looking at using the same routines that
are used to generate checksums for IP packets.

On an x86_64 KVM guest measurements with ftrace showed ~800ns to use
csum_partial vs ~1750ns for crc32.  The difference probably isn't
terribly significant, but for now we may as well use csum_partial.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Stones-thrown-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/cache.h
fs/nfsd/nfscache.c