linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* effect of nfs blocksize on I/O ?
@ 2003-09-29  6:42 Frank Cusack
  2003-09-29  7:19 ` Trond Myklebust
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Cusack @ 2003-09-29  6:42 UTC (permalink / raw)
  To: Trond Myklebust, torvalds; +Cc: lkml

I am not talking about rsize/wsize, rather the fs blocksize.

2.4 sets this to MIN(MAX(MAX(4096,rsize),wsize),32768) = 8192 typically.
2.6 sets this to nfs_fsinfo.wtmult?nfs_fsinfo.wtmult:512 = 512 typically.

(My estimation of "typical" may be way off though.)

At a 512 byte blocksize, this overflows struct statfs for fs > 1TB.
Most of my NFS filesystems (on netapp) are larger than that.

But more importantly, what does the VFS *do* with the blocksize?
strace seems to show that glibc/stdio does consider it.  If I fprintf()
two 4096 byte strings, libc does a single write() with 8192 blocksize,
and 3 write()'s for 512 blocksize.  I haven't looked to see what goes
over the wire, but I assume that still follows rsize/wsize.

Does any NFS server report wtmult?

Here's a patch.

/fc

--- a/fs/nfs/inode.c	2003-09-28 23:41:13.000000000 -0700
+++ b/fs/nfs/inode.c	2003-09-28 23:40:18.000000000 -0700
@@ -323,8 +323,8 @@
 		server->wsize = nfs_block_size(fsinfo.wtpref, NULL);
 	if (sb->s_blocksize == 0) {
 		if (fsinfo.wtmult == 0) {
-			sb->s_blocksize = 512;
-			sb->s_blocksize_bits = 9;
+			sb->s_blocksize = nfs_block_bits(server->rsize > server->wsize ? server->rsize : server->wsize,
+							 &sb->s_blocksize_bits);
 		} else
 			sb->s_blocksize = nfs_block_bits(fsinfo.wtmult,
 							 &sb->s_blocksize_bits);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-09-30  6:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-29  6:42 effect of nfs blocksize on I/O ? Frank Cusack
2003-09-29  7:19 ` Trond Myklebust
2003-09-29  7:52   ` Frank Cusack
2003-09-29  8:27     ` Trond Myklebust
2003-09-30  5:23       ` Frank Cusack
2003-09-30  6:04         ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).