Date: Wed, 25 Feb 1998 21:57:42 -0500 (EST) From: "John W. DeBoskey" <jwd@unx.sas.com> To: freebsd-current@FreeBSD.ORG Cc: jwd@unx.sas.com (John W. DeBoskey) Subject: vfs_bio.c/vfs_page_set_valid() NFS bug (and fix) Message-ID: <199802260257.AA06409@iluvatar.unx.sas.com>
next in thread | raw e-mail | index | archive | help
Hi,
Please commit the following patch to vfs_bio.c/vfs_page_set_valid().
* $Id: vfs_bio.c,v 1.151 1998/02/11 20:06:48 dg Exp $
# diff vfs_bio.c.orig vfs_bio.c
2127c2127
< ev = off + (bp->b_validend & ~(DEV_BSIZE - 1));
---
> ev = off + ((bp->b_validend + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1));
Due to the incorrect (trunc'ing) of ev, no partial block caching
is done for NFS based files. ie: A file of 16385 bytes will have the
1st 16k correctly cached, but the single byte of data will always
be dumped, thus forcing a readrpc to always be executed.
The above has been tested and works correctly.
I also beleive that 'sv' is incorrectly calculated, and should be done
as a trunc (like ev was).
sv = off + ((bp->b_validoff + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1));
should be:
sv = off + (bp->b_validoff & ~(DEV_BSIZE - 1));
I have not tested this out though with a physical gdb -k session and an
appropriate test program. Your comments are welcome.
Summary: sv should be trunc'd to the next lower DEV_BSIZE boundary.
ev should be rounded up to the next higher DEV_BSIZE boundary.
This causes a major performance boost for nfs mounted system builds.
Thanks,
John
ps: Now to work on the unrequired lookup & attr calls.
pss: I beleive that there are some bugs in either nfsstat or the actual
data collection scheme. nfsstat is supplying information that
doesn't match what I'm getting with my sniffer. I trust the sniffer.
Comments?
--
jwd@unx.sas.com (w) John W. De Boskey (919) 677-8000 x6915
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802260257.AA06409>
