From owner-freebsd-current Sat Feb 14 14:59:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA02866 for freebsd-current-outgoing; Sat, 14 Feb 1998 14:59:42 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from lamb.sas.com (root@lamb.sas.com [192.35.83.8]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA02861 for ; Sat, 14 Feb 1998 14:59:40 -0800 (PST) (envelope-from jwd@unx.sas.com) Received: from mozart (wether.sas.com [192.35.83.7]) by lamb.sas.com (8.8.7/8.8.7) with SMTP id OAA00244 for ; Sat, 14 Feb 1998 14:49:59 -0500 (EST) Received: from iluvatar.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90) id AA18968; Sat, 14 Feb 1998 14:49:59 -0500 From: "John W. DeBoskey" Received: by iluvatar.unx.sas.com (5.65c/SAS/Generic 9.01/3-26-93) id AA25321; Sat, 14 Feb 1998 14:49:58 -0500 Message-Id: <199802141949.AA25321@iluvatar.unx.sas.com> Subject: Terry's DIFF.LEASE(Ok) & NFS V3 caching problem To: freebsd-current@FreeBSD.ORG Date: Sat, 14 Feb 1998 14:49:58 -0500 (EST) Cc: jwd@unx.sas.com (John W. DeBoskey) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, I have applied DIFF.LEASE from Terry's FreeBSD Page. It was applied against the 3.0-980212-SNAP. The patched files: /usr/src/sys/kern: -rw-r--r-- 1 root wheel 12494 Dec 5 14:55 kern_ktrace.c.orig -rw-r--r-- 1 root wheel 11171 Nov 20 15:07 link_aout.c.orig -rw-r--r-- 1 root wheel 5593 Jan 23 21:54 tty_tty.c.orig -rw-r--r-- 1 root wheel 12670 Feb 6 07:13 vfs_vnops.c.orig with versions: * $Id: kern_ktrace.c,v 1.22 1997/12/05 19:55:38 bde Exp $ * $Id: link_aout.c,v 1.5 1997/11/20 20:07:50 bde Exp $ * $Id: tty_tty.c,v 1.22 1998/01/24 02:54:35 eivind Exp $ * $Id: vfs_vnops.c,v 1.49 1998/02/06 12:13:33 eivind Exp $ In and of themselves, the patches applied cleanly. Heavy NFS V3 usage to a network appliance F540 showed no problems. Thus, I give this patch a thumbs up with regards to my testing. The reason I applied these diffs was an attempt to see if they had any effect on the following problem. I have a file which is 16385 bytes on the NFS server. When the file is cat'd there is a series of additional rpc reads done due to incorrect EOF detection and partial block caching. The following sniffer output of the 1st cat execution shows this. Consecutive cat's always go to the server to read the final byte of the file. SUMMARY Delta T Dest Source Summary 46 [.11] [.213] NFS C LOOKUP 16385.bytes in FH=B056 47 0.00025 [.213] [.11] NFS R LOOKUP OK FH=B517 48 0.00014 [.11] [.213] NFS C ACCESS FH=B517 (Read) 49 0.00018 [.213] [.11] NFS R ACCESS OK (Read) 50 0.00027 [.11] [.213] NFS C FSINFO FH=B517 51 0.00018 [.213] [.11] NFS R FSINFO OK 52 0.00019 [.11] [.213] NFS C READ FH=B517 at 0 for 8192 53 0.00003 [.11] [.213] NFS C READ FH=B517 at 8192 for 8192 54 0.00058 [.213] [.11] NFS R READ OK 8192 bytes 58 0.00085 [.213] [.11] NFS R READ OK 8192 bytes 63 0.00050 [.11] [.213] NFS C READ FH=B517 at 16384 for 8192 66 0.00020 [.213] [.11] NFS R READ OK 1 byte (EOF) 67 0.00035 [.11] [.213] Read/write overlap NFS C READ FH=B517 at 16384 for 512 68 0.00024 [.213] [.11] NFS R READ OK 1 byte (EOF) 69 0.00016 [.11] [.213] File retransmission NFS C READ FH=B517 at 16384 for 512 70 0.00023 [.213] [.11] NFS R READ OK 1 byte (EOF) The following patch to nfs_bio.c removes the additional readrpc calls. It does not address the lack of caching of the last partial block of the file (a possible bug in the brelse() & vm_page_is_valid() fuctions or related code. ie: m->valid is 0). * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 * $Id: nfs_bio.c,v 1.47 1998/01/25 06:24:09 dyson Exp $ # diff nfs_bio.c~ nfs_bio.c 242a243,246 > if (uio->uio_offset >= np->n_size) { /* Req past EOF? */ > n = 0; bp = 0; > break; > } 452a457,458 > if (uio->uio_offset >= np->n_size) > n=0; Unless there is a better way of fixing this problem, would someone please test & commit this small patch? Comments? Critiques? Thanks, John -- 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