Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 1998 22:31:25 -0800
From:      Mike Smith <mike@smith.net.au>
To:        "John W. DeBoskey" <jwd@unx.sas.com>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: vfs_bio.c/vfs_page_set_valid() NFS bug (and fix) 
Message-ID:  <199802260631.WAA22718@dingo.cdrom.com>
In-Reply-To: Your message of "Wed, 25 Feb 1998 21:57:42 EST." <199802260257.AA06409@iluvatar.unx.sas.com> 

next in thread | previous 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 $

Can someone confirm/deny this for 2.2 as well?  I'll do both as soon as 
I have an answer.

> 
> # 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
> 

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



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?199802260631.WAA22718>