From owner-cvs-src@FreeBSD.ORG Sun Dec 16 06:26:20 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 B3C3916A417; Sun, 16 Dec 2007 06:26:20 +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 686ED13C45B; Sun, 16 Dec 2007 06:26:20 +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 lBG6QFwQ026706; Sun, 16 Dec 2007 01:26:16 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Sat, 15 Dec 2007 20:28:05 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Jeff Roberson In-Reply-To: <200712160621.lBG6LLph050771@repoman.freebsd.org> Message-ID: <20071215202621.N922@desktop> References: <200712160621.lBG6LLph050771@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/kern kern_event.c kern_thread.c sys_generic.c sys_pipe.c uipc_sockbuf.c src/sys/netncp ncp_rq.c ncp_sock.c ncp_sock.h src/sys/netsmb smb_trantcp.c src/sys/sys proc.h selinfo.h socketvar.h systm.h 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: Sun, 16 Dec 2007 06:26:20 -0000 This has been hanging around for at least 6 months with various people using it. I should've mentioned also that I had to change a number of places that try to optimize away selwakeup/selrecord calls using a flag that requires whether there is a waiter or not. We used to only support one waiter, but now you must use SEL_WAITING to determine if this is the case. Hopefully I found all of these places. Thanks, Jeff On Sun, 16 Dec 2007, Jeff Roberson wrote: > jeff 2007-12-16 06:21:20 UTC > > FreeBSD src repository > > Modified files: > sys/kern kern_event.c kern_thread.c sys_generic.c > sys_pipe.c uipc_sockbuf.c > sys/netncp ncp_rq.c ncp_sock.c ncp_sock.h > sys/netsmb smb_trantcp.c > sys/sys proc.h selinfo.h socketvar.h systm.h > Log: > Refactor select to reduce contention and hide internal implementation > details from consumers. > > - Track individual selecters on a per-descriptor basis such that there > are no longer collisions and after sleeping for events only those > descriptors which triggered events must be rescaned. > - Protect the selinfo (per descriptor) structure with a mtx pool mutex. > mtx pool mutexes were chosen to preserve api compatibility with > existing code which does nothing but bzero() to setup selinfo > structures. > - Use a per-thread wait channel rather than a global wait channel. > - Hide select implementation details in a seltd structure which is > opaque to the rest of the kernel. > - Provide a 'selsocket' interface for those kernel consumers who wish to > select on a socket when they have no fd so they no longer have to > be aware of select implementation details. > > Tested by: kris > Reviewed on: arch > > Revision Changes Path > 1.114 +6 -3 src/sys/kern/kern_event.c > 1.264 +2 -0 src/sys/kern/kern_thread.c > 1.160 +414 -168 src/sys/kern/sys_generic.c > 1.194 +6 -3 src/sys/kern/sys_pipe.c > 1.173 +2 -1 src/sys/kern/uipc_sockbuf.c > 1.16 +9 -3 src/sys/netncp/ncp_rq.c > 1.20 +0 -105 src/sys/netncp/ncp_sock.c > 1.7 +0 -3 src/sys/netncp/ncp_sock.h > 1.27 +1 -79 src/sys/netsmb/smb_trantcp.c > 1.498 +2 -3 src/sys/sys/proc.h > 1.19 +8 -8 src/sys/sys/selinfo.h > 1.159 +2 -0 src/sys/sys/socketvar.h > 1.263 +0 -4 src/sys/sys/systm.h >