From owner-cvs-src@FreeBSD.ORG Mon Dec 31 00:49:06 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DED616A41A; Mon, 31 Dec 2007 00:49:06 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id B12F813C46A; Mon, 31 Dec 2007 00:49:05 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.107] (cpe-24-94-75-93.hawaii.res.rr.com [24.94.75.93]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id lBV0mwdk046354; Sun, 30 Dec 2007 19:48:59 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Sun, 30 Dec 2007 14:50:00 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Jeff Roberson In-Reply-To: <200712300142.lBU1gF6G049616@repoman.freebsd.org> Message-ID: <20071230144224.W957@desktop> References: <200712300142.lBU1gF6G049616@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/compat/svr4 svr4_stream.c src/sys/dev/streams streams.c src/sys/fs/devfs devfs_vnops.c src/sys/fs/fifofs fifo_vnops.c src/sys/kern kern_descrip.c kern_event.c sys_generic.c sys_pipe.c uipc_mqueue.c uipc_syscalls.c ... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2007 00:49:06 -0000 On Sun, 30 Dec 2007, Jeff Roberson wrote: > jeff 2007-12-30 01:42:15 UTC > > FreeBSD src repository > > Modified files: > sys/compat/svr4 svr4_stream.c > sys/dev/streams streams.c > sys/fs/devfs devfs_vnops.c > sys/fs/fifofs fifo_vnops.c > sys/kern kern_descrip.c kern_event.c sys_generic.c > sys_pipe.c uipc_mqueue.c uipc_syscalls.c > uipc_usrreq.c vfs_syscalls.c vfs_vnops.c > sys/netgraph ng_socket.c > sys/opencrypto cryptodev.c > sys/sys file.h unpcb.h > Log: > Remove explicit locking of struct file. I got a few questions about this in private so I'll elaborate a bit. This more than halves the number of atomic operations that are normally done, shrinks the size of struct file, and eliminates some global contention points. Previously we used a mtx pool to protect the ref count, so we would lock, ref, unlock, do something, lock unref, unlock. Now that's only two atomics and no real contention. This helps performance for multithreaded programs and non multi-threaded programs. Cheers, Jeff > - Introduce a finit() which is used to initailize the fields of struct file > in such a way that the ops vector is only valid after the data, type, > and flags are valid. > - Protect f_flag and f_count with atomic operations. > - Remove the global list of all files and associated accounting. > - Rewrite the unp garbage collection such that it no longer requires > the global list of all files and instead uses a list of all unp sockets. > - Mark sockets in the accept queue so we don't incorrectly gc them. > > Tested by: kris, pho > > Revision Changes Path > 1.63 +0 -4 src/sys/compat/svr4/svr4_stream.c > 1.57 +1 -6 src/sys/dev/streams/streams.c > 1.151 +1 -4 src/sys/fs/devfs/devfs_vnops.c > 1.139 +1 -4 src/sys/fs/fifofs/fifo_vnops.c > 1.315 +67 -105 src/sys/kern/kern_descrip.c > 1.115 +11 -23 src/sys/kern/kern_event.c > 1.161 +4 -8 src/sys/kern/sys_generic.c > 1.195 +2 -12 src/sys/kern/sys_pipe.c > 1.26 +11 -12 src/sys/kern/uipc_mqueue.c > 1.261 +5 -28 src/sys/kern/uipc_syscalls.c > 1.208 +177 -239 src/sys/kern/uipc_usrreq.c > 1.445 +15 -19 src/sys/kern/vfs_syscalls.c > 1.254 +9 -5 src/sys/kern/vfs_vnops.c > 1.84 +1 -1 src/sys/netgraph/ng_socket.c > 1.36 +1 -6 src/sys/opencrypto/cryptodev.c > 1.74 +31 -60 src/sys/sys/file.h > 1.23 +8 -1 src/sys/sys/unpcb.h >