From owner-freebsd-hackers Sun Jan 17 21:14:31 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA16656 for freebsd-hackers-outgoing; Sun, 17 Jan 1999 21:14:31 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA16649; Sun, 17 Jan 1999 21:14:29 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.1/8.9.1) id VAA57485; Sun, 17 Jan 1999 21:14:25 -0800 (PST) (envelope-from dillon) Date: Sun, 17 Jan 1999 21:14:25 -0800 (PST) From: Matthew Dillon Message-Id: <199901180514.VAA57485@apollo.backplane.com> To: "John S. Dyson" , dg@root.com, jkh@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Found problem w/ Paging performance over NFS Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is pretty cool - I figured out why the paging performance is so horrible over NFS but good to local disk. It turns out that the NFS subsystem looks at B_ASYNC in the bp. This flag is not set by the paging code, so the NFS writes requested by the pageout daemon were being done synchronously. Setting B_ASYNC makes the paging go a whole lot faster, but creates other problems relating to pbgetvp() and pbrelvp() calls - these calls associate a vnode with a bp without linking the bp into the vnode or messing with the vnode's reference count. The problem is that NFS ( and possibly other subsystems), assumes that it can call reassignbuf() on any bp when, in fact, it can't. bp's handed to them from the paging system ( or any other subsystem that uses pbgetvp() ) cannot be reassigned using reassignbuf(). nfs_doio() hits this sometimes when you ^C a program. In anycase, I fixed things up to formally separate bp's that use pbgetvp() and bp's that do not, put in some asserts to enforce it, and fixed the code in nfs_doio() that was messing things up. The B_PAGING flag is now associated specifically with 'bp's that quickly assign b_vp without messing with links or reference counts'. I've also upgraded my LAN to 100BaseTX to test it. With 4 nfsiod's running, I am getting excellent paging performance to NFS swap - 1.5 to 2.5 megabytes a second on pageout instead of 250 KBytes/sec. The diskless workstation now pages out as well as a normal server! -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message