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/inode.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/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 4e6558df54b8..acde2c5725bf 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -221,10 +221,10 @@ nfs_calc_block_size(u64 tsize) | |||
221 | static inline unsigned long | 221 | static inline unsigned long |
222 | nfs_block_size(unsigned long bsize, unsigned char *nrbitsp) | 222 | nfs_block_size(unsigned long bsize, unsigned char *nrbitsp) |
223 | { | 223 | { |
224 | if (bsize < 1024) | 224 | if (bsize < NFS_MIN_FILE_IO_SIZE) |
225 | bsize = NFS_DEF_FILE_IO_BUFFER_SIZE; | 225 | bsize = NFS_DEF_FILE_IO_SIZE; |
226 | else if (bsize >= NFS_MAX_FILE_IO_BUFFER_SIZE) | 226 | else if (bsize >= NFS_MAX_FILE_IO_SIZE) |
227 | bsize = NFS_MAX_FILE_IO_BUFFER_SIZE; | 227 | bsize = NFS_MAX_FILE_IO_SIZE; |
228 | 228 | ||
229 | return nfs_block_bits(bsize, nrbitsp); | 229 | return nfs_block_bits(bsize, nrbitsp); |
230 | } | 230 | } |
@@ -307,20 +307,15 @@ nfs_sb_init(struct super_block *sb, rpc_authflavor_t authflavor) | |||
307 | max_rpc_payload = nfs_block_size(rpc_max_payload(server->client), NULL); | 307 | max_rpc_payload = nfs_block_size(rpc_max_payload(server->client), NULL); |
308 | if (server->rsize > max_rpc_payload) | 308 | if (server->rsize > max_rpc_payload) |
309 | server->rsize = max_rpc_payload; | 309 | server->rsize = max_rpc_payload; |
310 | if (server->wsize > max_rpc_payload) | 310 | if (server->rsize > NFS_MAX_FILE_IO_SIZE) |
311 | server->wsize = max_rpc_payload; | 311 | server->rsize = NFS_MAX_FILE_IO_SIZE; |
312 | |||
313 | server->rpages = (server->rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 312 | server->rpages = (server->rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
314 | if (server->rpages > NFS_READ_MAXIOV) { | ||
315 | server->rpages = NFS_READ_MAXIOV; | ||
316 | server->rsize = server->rpages << PAGE_CACHE_SHIFT; | ||
317 | } | ||
318 | 313 | ||
314 | if (server->wsize > max_rpc_payload) | ||
315 | server->wsize = max_rpc_payload; | ||
316 | if (server->wsize > NFS_MAX_FILE_IO_SIZE) | ||
317 | server->wsize = NFS_MAX_FILE_IO_SIZE; | ||
319 | server->wpages = (server->wsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 318 | server->wpages = (server->wsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
320 | if (server->wpages > NFS_WRITE_MAXIOV) { | ||
321 | server->wpages = NFS_WRITE_MAXIOV; | ||
322 | server->wsize = server->wpages << PAGE_CACHE_SHIFT; | ||
323 | } | ||
324 | 319 | ||
325 | if (sb->s_blocksize == 0) | 320 | if (sb->s_blocksize == 0) |
326 | sb->s_blocksize = nfs_block_bits(server->wsize, | 321 | sb->s_blocksize = nfs_block_bits(server->wsize, |