diff options
author | mav <mav@FreeBSD.org> | 2014-01-22 23:48:15 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-01-22 23:48:15 +0000 |
commit | bdd6d3eac30a1b1bc1a64aa98b935921e5cef1c6 (patch) | |
tree | d09b8b7ec9e4280535791f84797e3b7760469900 /sys/nfs | |
parent | 76d8788652a3da858c696457a1903a205f3684e7 (diff) | |
download | FreeBSD-src-bdd6d3eac30a1b1bc1a64aa98b935921e5cef1c6.zip FreeBSD-src-bdd6d3eac30a1b1bc1a64aa98b935921e5cef1c6.tar.gz |
MFC r259765:
Fix RPC server threads file handle affinity to work better with ZFS.
Instead of taking 8 specific bytes of file handle to identify file during
RPC thread affitinity handling, use trivial hash of the full file handle.
ZFS's struct zfid_short does not have padding field after the length field,
as result, originally picked 8 bytes are loosing lower 16 bits of object ID,
causing many false matches and unneeded requests affinity to same thread.
This fix substantially improves NFS server latency and scalability in SPEC
NFS benchmark by more flexible use of multiple NFS threads.
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_fha.c | 5 | ||||
-rw-r--r-- | sys/nfs/nfs_fha.h | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/sys/nfs/nfs_fha.c b/sys/nfs/nfs_fha.c index 2290804..1892729 100644 --- a/sys/nfs/nfs_fha.c +++ b/sys/nfs/nfs_fha.c @@ -130,7 +130,6 @@ fha_extract_info(struct svc_req *req, struct fha_info *i, struct fha_callbacks *cb) { struct mbuf *md; - fhandle_t fh; caddr_t dpos; static u_int64_t random_fh = 0; int error; @@ -177,12 +176,10 @@ fha_extract_info(struct svc_req *req, struct fha_info *i, dpos = mtod(md, caddr_t); /* Grab the filehandle. */ - error = cb->get_fh(&fh, v3, &md, &dpos); + error = cb->get_fh(&i->fh, v3, &md, &dpos); if (error) goto out; - bcopy(fh.fh_fid.fid_data, &i->fh, sizeof(i->fh)); - /* Content ourselves with zero offset for all but reads. */ if (cb->is_read(procnum) || cb->is_write(procnum)) cb->get_offset(&md, &dpos, v3, i); diff --git a/sys/nfs/nfs_fha.h b/sys/nfs/nfs_fha.h index ef5ada0..d3dd039 100644 --- a/sys/nfs/nfs_fha.h +++ b/sys/nfs/nfs_fha.h @@ -82,7 +82,7 @@ struct fha_info { struct fha_callbacks { rpcproc_t (*get_procnum)(rpcproc_t procnum); int (*realign)(struct mbuf **mb, int malloc_flags); - int (*get_fh)(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos); + int (*get_fh)(uint64_t *fh, int v3, struct mbuf **md, caddr_t *dpos); int (*is_read)(rpcproc_t procnum); int (*is_write)(rpcproc_t procnum); int (*get_offset)(struct mbuf **md, caddr_t *dpos, int v3, struct |