From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Frank Cusack <fcusack@fcusack.com>
Cc: torvalds@osdl.org, lkml <linux-kernel@vger.kernel.org>
Subject: effect of nfs blocksize on I/O ?
Date: Mon, 29 Sep 2003 00:19:30 -0700 [thread overview]
Message-ID: <16247.56578.861224.328086@charged.uio.no> (raw)
In-Reply-To: <20030928234236.A16924@google.com>
>>>>> " " == Frank Cusack <fcusack@fcusack.com> writes:
> 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.
Then you should use statfs64()/statvfs64(). Nobody is going to
guarantee to you that the equivalent 32-bit syscalls will hold for
arbitrary disk sizes.
> 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.
In NFS you need to distinguish between the 'block size' (bsize) and
the 'fragment size' (frsize). The former is defined as the "optimal
transfer block size", the latter is the "block size on the underlying
filesystem" according to the manpages.
These are SUS-mandated definitions...
The VFS itself cares little about the blocksize, however programs like
'df' are supposed to use the fragment size as their basic unit when
reporting space usage. Putting arbitrary values in place of the true
fragment size typically leads to rounding errors, and so is not
recommended.
OTOH, bsize is of informational interest to programs that wish to
optimize I/O throughput by grouping their data into appropriately
sized records.
Cheers,
Trond
next prev parent reply other threads:[~2003-09-29 7:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-29 6:42 Frank Cusack
2003-09-29 7:19 ` Trond Myklebust [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16247.56578.861224.328086@charged.uio.no \
--to=trond.myklebust@fys.uio.no \
--cc=fcusack@fcusack.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®