From owner-cvs-all Wed Jul 10 10: 2:54 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F23137B401; Wed, 10 Jul 2002 10:02:34 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A734943E5E; Wed, 10 Jul 2002 10:02:33 -0700 (PDT) (envelope-from dillon@FreeBSD.org) Received: from freefall.freebsd.org (dillon@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6AH2XJU000529; Wed, 10 Jul 2002 10:02:33 -0700 (PDT) (envelope-from dillon@freefall.freebsd.org) Received: (from dillon@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6AH2Xtl000528; Wed, 10 Jul 2002 10:02:33 -0700 (PDT) Message-Id: <200207101702.g6AH2Xtl000528@freefall.freebsd.org> From: Matt Dillon Date: Wed, 10 Jul 2002 10:02:32 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern vfs_bio.c vfs_cluster.c vfs_subr.c src/sys/nfsclient nfs_bio.c src/sys/nfsserver nfs_serv.c src/sys/sys buf.h vnode.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG dillon 2002/07/10 10:02:32 PDT Modified files: sys/kern vfs_bio.c vfs_cluster.c vfs_subr.c sys/nfsclient nfs_bio.c sys/nfsserver nfs_serv.c sys/sys buf.h vnode.h Log: Replace the global buffer hash table with per-vnode splay trees using a methodology similar to the vm_map_entry splay and the VM splay that Alan Cox is working on. Extensive testing has appeared to have shown no increase in overhead. Disadvantages Dirties more cache lines during lookups. Not as fast as a hash table lookup (but still N log N and optimal when there is locality of reference). Advantages vnode->v_dirtyblkhd is now perfectly sorted, making fsync/sync/filesystem syncer operate more efficiently. I get to rip out all the old hacks (some of which were mine) that tried to keep the v_dirtyblkhd tailq sorted. The per-vnode splay tree should be easier to lock / SMPng pushdown on vnodes will be easier. This commit along with another that Alan is working on for the VM page global hash table will allow me to implement ranged fsync(), optimize server-side nfs commit rpcs, and implement partial syncs by the filesystem syncer (aka filesystem syncer would detect that someone is trying to get the vnode lock, remembers its place, and skip to the next vnode). Note that the buffer cache splay is somewhat more complex then other splays due to special handling of background bitmap writes (multiple buffers with the same lblkno in the same vnode), and B_INVAL discontinuities between the old hash table and the existence of the buffer on the v_cleanblkhd list. Suggested by: alc Revision Changes Path 1.319 +50 -7 src/sys/kern/vfs_bio.c 1.121 +8 -4 src/sys/kern/vfs_cluster.c 1.377 +205 -85 src/sys/kern/vfs_subr.c 1.109 +2 -2 src/sys/nfsclient/nfs_bio.c 1.120 +7 -1 src/sys/nfsserver/nfs_serv.c 1.136 +8 -1 src/sys/sys/buf.h 1.188 +4 -2 src/sys/sys/vnode.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message