diff options
author | Chuck Lever <cel@netapp.com> | 2005-11-30 18:09:02 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-06 14:58:49 -0500 |
commit | 40859d7ee64ed6bfad8a4e93f9bb5c1074afadff (patch) | |
tree | ed4069423c3d6551035d5b6116f50452cdac4103 /fs/nfs/direct.c | |
parent | 325cfed9ae901320e9234b18c21434b783dbe342 (diff) |
NFS: support large reads and writes on the wire
Most NFS server implementations allow up to 64KB reads and writes on the
wire. The Solaris NFS server allows up to a megabyte, for instance.
Now the Linux NFS client supports transfer sizes up to 1MB, too. This will
help reduce protocol and context switch overhead on read/write intensive NFS
workloads, and support larger atomic read and write operations on servers
that support them.
Test-plan:
Connectathon and iozone on mount point with wsize=rsize>32768 over TCP.
Tests with NFS over UDP to verify the maximum RPC payload size cap.
Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index f69d95aa78b2..fd7ac5e841c1 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -154,6 +154,7 @@ static struct nfs_direct_req *nfs_direct_read_alloc(size_t nbytes, unsigned int | |||
154 | struct list_head *list; | 154 | struct list_head *list; |
155 | struct nfs_direct_req *dreq; | 155 | struct nfs_direct_req *dreq; |
156 | unsigned int reads = 0; | 156 | unsigned int reads = 0; |
157 | unsigned int rpages = (rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | ||
157 | 158 | ||
158 | dreq = kmem_cache_alloc(nfs_direct_cachep, SLAB_KERNEL); | 159 | dreq = kmem_cache_alloc(nfs_direct_cachep, SLAB_KERNEL); |
159 | if (!dreq) | 160 | if (!dreq) |
@@ -167,7 +168,7 @@ static struct nfs_direct_req *nfs_direct_read_alloc(size_t nbytes, unsigned int | |||
167 | 168 | ||
168 | list = &dreq->list; | 169 | list = &dreq->list; |
169 | for(;;) { | 170 | for(;;) { |
170 | struct nfs_read_data *data = nfs_readdata_alloc(); | 171 | struct nfs_read_data *data = nfs_readdata_alloc(rpages); |
171 | 172 | ||
172 | if (unlikely(!data)) { | 173 | if (unlikely(!data)) { |
173 | while (!list_empty(list)) { | 174 | while (!list_empty(list)) { |
@@ -431,7 +432,7 @@ static ssize_t nfs_direct_write_seg(struct inode *inode, | |||
431 | struct nfs_writeverf first_verf; | 432 | struct nfs_writeverf first_verf; |
432 | struct nfs_write_data *wdata; | 433 | struct nfs_write_data *wdata; |
433 | 434 | ||
434 | wdata = nfs_writedata_alloc(); | 435 | wdata = nfs_writedata_alloc(NFS_SERVER(inode)->wpages); |
435 | if (!wdata) | 436 | if (!wdata) |
436 | return -ENOMEM; | 437 | return -ENOMEM; |
437 | 438 | ||