Subject: kern/2978: NFS files' st_blksize is ... hard to believe
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cgd@cs.cmu.edu>
List: netbsd-bugs
Date: 11/30/1996 14:22:02
>Number: 2978
>Category: kern
>Synopsis: NFS files' st_blksize == 512, which is probably too small.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Nov 30 11:35:00 1996
>Last-Modified:
>Originator: Chris G. Demetriou
>Organization:
Kernel Hackers 'r' Us
>Release: NetBSD-current, November 30, 1996
>Environment:
System: NetBSD bunnahabhain.pdl.cs.cmu.edu 1.2B NetBSD 1.2B (GENERIC) #271: Sat Nov 30 11:00:17 EST 1996 cgd@bunnahabhain.pdl.cs.cmu.edu:/usr/src/sys/arch/alpha/compile/GENERIC alpha
>Description:
stat(2) says that the st_blksize field of struct stat is the
"optimal file sys I/O ops blocksize."
For NFS files (and directories), st_blksize is always set to
512. It's not at all clear that this is the "optimal" file
system I/O block size. A more plausible value is the maximum
read or write RPC size (pick one, they're both currently the
same in our code).
>How-To-Repeat:
stat() NFS files, note that their st_blksize is 512, and remember
everything you've ever learned about the fact that doing small
I/Os is bad.
>Fix:
Pick a better value (one is proposed above), and use that instead
of hard-coding 512.
>Audit-Trail:
>Unformatted: