From owner-freebsd-arch@FreeBSD.ORG Thu Aug 16 14:57:57 2007 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E16D16A419 for ; Thu, 16 Aug 2007 14:57:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 47EEE13C459 for ; Thu, 16 Aug 2007 14:57:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8k) with ESMTP id 203659652-1834499 for multiple; Thu, 16 Aug 2007 10:57:57 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l7GEvn9o046082; Thu, 16 Aug 2007 10:57:50 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-arch@freebsd.org Date: Thu, 16 Aug 2007 10:56:31 -0400 User-Agent: KMail/1.9.6 References: <20070815233852.X568@10.0.0.1> In-Reply-To: <20070815233852.X568@10.0.0.1> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200708161056.31494.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 16 Aug 2007 10:57:50 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3966/Wed Aug 15 20:48:06 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Subject: Re: file locking. 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: Thu, 16 Aug 2007 14:57:57 -0000 On Thursday 16 August 2007 03:01:18 am Jeff Roberson wrote: > I have been looking at file locking for 8.0 and have come up with a way to > completely eliminate the file lock, reduce the size of struct file by > ~4 pointers (22%), remove the global list of files and associated lock, > and restrict the scope of unp_gc while removing several race conditions. I like finit(). I would maybe change socketpair() to pass so1 and so2 to finit() rather than setting f_data twice. Did you consider using refcount_* for f_count rather than using the atomic operations directly? It appears you never call unp_discard() and thus 'closef()' on the sockets in unp_gc() now. Perhaps the fdrop()'s in the end of the loop should be unp_discard()'s instead? Also, it's a bit of a shame to lose 'show files' from ddb. -- John Baldwin