From owner-freebsd-current Wed Feb 25 22:32:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA29995 for freebsd-current-outgoing; Wed, 25 Feb 1998 22:32:38 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA29976 for ; Wed, 25 Feb 1998 22:32:35 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost [127.0.0.1]) by dingo.cdrom.com (8.8.8/8.8.5) with ESMTP id WAA22718; Wed, 25 Feb 1998 22:31:28 -0800 (PST) Message-Id: <199802260631.WAA22718@dingo.cdrom.com> X-Mailer: exmh version 2.0zeta 7/24/97 To: "John W. DeBoskey" cc: freebsd-current@FreeBSD.ORG Subject: Re: vfs_bio.c/vfs_page_set_valid() NFS bug (and fix) In-reply-to: Your message of "Wed, 25 Feb 1998 21:57:42 EST." <199802260257.AA06409@iluvatar.unx.sas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 25 Feb 1998 22:31:25 -0800 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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