From owner-cvs-all@FreeBSD.ORG Wed Mar 15 13:55:21 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org 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 EF3AB16A400; Wed, 15 Mar 2006 13:55:21 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id B67CB43D45; Wed, 15 Mar 2006 13:55:21 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 882271A4E3F; Wed, 15 Mar 2006 05:55:21 -0800 (PST) Date: Wed, 15 Mar 2006 05:55:21 -0800 From: Alfred Perlstein To: Robert Watson Message-ID: <20060315135521.GH23971@elvis.mu.org> References: <200603151245.k2FCjawp043512@repoman.freebsd.org> <20060315130030.GG23971@elvis.mu.org> <20060315133630.H5861@fledge.watson.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060315133630.H5861@fledge.watson.org> User-Agent: Mutt/1.4.2.1i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2006 13:55:22 -0000 1) apologies for top posting 2) cool, thanks for the explanation, I wasn't aware that this was a cleanup step and was hoping it wasn't another ad-hoc reference counting "fix". This looks good. * Robert Watson [060315 05:48] wrote: > > Socket and PCB reference counting is currently Extraordinarily Complex and > More Than A Little Broken. This is the first in a long series of steps to > migrate the socket and protocol code from an ad hoc reference system to a > more pure reference system. This includes: > > - Transitioning so_pcb to being a protocol-only field, instead of allowing > the > socket layer to use it. SS_PROTOREF is, in effect, replacing so_pcb as a > reference visible to the socket layer. > > - Moving towards an invariant that so_pcb is non-NULL for the life time of a > socket for most protocol, allowing us to remove the constant checking for > a > NULL so_pcb (and associated locking) throughout the protocols. This > involves a significant rewrite of TCP's pcb use, as we currently discard > the > PCB long before the socket is freed, hence significant complexity in all > the > TCP protocol APIs exposed to the socket layer. > > - Guaranteeing that pru_detach() will only be called once per socket, and > only > if pru_attach() succeeded. > > - Eliminating unused failure modes, such as the failure of pru_detach() and > pru_abort(). > > - Fixing a large number of race conditions and bugs in the TCP tcpcb and > twpcb > model. > > I would like to get to the point where so_count is the sole reference count > on the socket, but it will take quite a bit of work to get there. You can > find an outstanding, if somewhat dated, patch at: > > http://www.watson.org/~robert/freebsd/netperf/20060228-rwatson_sockref.diff > > Cleaning up and merging large parts of this is waiting on a couple of > things, including updates to the bluetooth code (I've contacted emax > already), and also on a determination of the future of netatm. I have > changes in that patch to make netatm compile, but I'm unable to test it, > and fairly sure there is more to be done there. > > Robert N M Watson -- - Alfred Perlstein - CTO Okcupid.com / FreeBSD Hacker / All that jazz -