From owner-freebsd-arch@FreeBSD.ORG Sat Jul 15 11:35:14 2006 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6BD816A4DD; Sat, 15 Jul 2006 11:35:14 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from mrout2-b.corp.dcn.yahoo.com (mrout2-b.corp.dcn.yahoo.com [216.109.112.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F7A943D46; Sat, 15 Jul 2006 11:35:14 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (proxy8.corp.yahoo.com [216.145.48.13]) by mrout2-b.corp.dcn.yahoo.com (8.13.6/8.13.6/y.out) with ESMTP id k6FBYxOx047414; Sat, 15 Jul 2006 04:34:59 -0700 (PDT) Date: Sat, 15 Jul 2006 14:54:05 +0900 Message-ID: From: gnn@freebsd.org To: Robert Watson In-Reply-To: <20060618014337.V67789@fledge.watson.org> References: <20060618014337.V67789@fledge.watson.org> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.0.50 (i386-apple-darwin8.6.1) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: arch@freebsd.org Subject: Re: Proposal: add pru_close protosw method, refactor abort/detach X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2006 11:35:14 -0000 At Sun, 18 Jun 2006 02:01:01 +0100 (BST), rwatson wrote: > > > Over the past 6-12 months, I've spent quite a bit of time working with our > socket and protocol locking and reference models. These efforts have been > aimed at a couple of things: Apologies for the length of time I let this sit. > Attached is a patch that attempts to further rationalize tear-down. > Specifically, it refactors pru_detach (disconnect and conditionally > free) and pru_abort (disconnect abruptly and free) into three > protocol switch functions: > > pru_close: socket has been closed and a sensible shutdown without > data loss is desired. > > pru_abort: socket is being aborted, generally due to insufficient queue space > in a listen socket, or close of a listen socket while connections are waiting > to be accepted: close abruptly and potentially with data loss. > > pru_detach: teardown is now unconditional -- both the protocol and socket are > done. > This to me is a sensible approach and if it works for both TCP and SCTP then I suspect it should work for other protocols which are less complicated. > The changes require protocol implementors to distinguish close and > deatch, which while generally clarifying for some protocols (such as > TCP, where the logic becomes much more clear), for others it has > never been clear how exactly close worked, and does not become > clearer. I believe your statements above are clear. Can you put similar, sensible comments in places where protocols implementors are likely to see them? > What I'm looking for: > > - yay/nay on this approach, and the general change in protosw > behavior. It does touch all protocols, but I think makes things > generally more sensible. this doesn't just support the > resock_vertical exploration, but also generally makes things more > sensible by moving towards a more typical constructor/destructor > and avoiding combining protocol state transitions with socket > state freeing. Yay. > - Review of the details of the patch. In particular, help deciding > if my splitting up of events between pru_abort, pru_close, and > pru_detach for each protocol is right. It "looks" OK. Is there a branch you have that I can create a p4 client for and do my usual NetPIPE style abuse testing? I have been trying to make a nightly test script for NetPIPE so it might be a good thing to try on this branch. Later, George