From owner-freebsd-arch@FreeBSD.ORG Thu Aug 16 20:16:02 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 4C24316A417; Thu, 16 Aug 2007 20:16:02 +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 11DA713C478; Thu, 16 Aug 2007 20:16:01 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.103] (c-67-160-44-208.hsd1.wa.comcast.net [67.160.44.208]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id l7GKFvGf015845 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Thu, 16 Aug 2007 16:15:59 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Thu, 16 Aug 2007 13:18:51 -0700 (PDT) From: Jeff Roberson X-X-Sender: jroberson@10.0.0.1 To: John Baldwin In-Reply-To: <200708161056.31494.jhb@freebsd.org> Message-ID: <20070816131327.J568@10.0.0.1> References: <20070815233852.X568@10.0.0.1> <200708161056.31494.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org 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 20:16:02 -0000 On Thu, 16 Aug 2007, John Baldwin wrote: > 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. > Thanks for the review. > I like finit(). I would maybe change socketpair() to pass so1 and so2 to > finit() rather than setting f_data twice. I'm not sure what you mean? > > Did you consider using refcount_* for f_count rather than using the atomic > operations directly? Yes, I may change it. I was investigating some schemes where it may not have been sufficient but I think it will work fine for what I've settled on. I also think I'll wrap some atomics for manipulating f_type in macros. > > 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? unp_discard() happens as a side-effect of sorflush(). > > Also, it's a bit of a shame to lose 'show files' from ddb. Yes, I can re-implement that using the same technique as sysctl kern.file. What's more troubling is the continued erosion of support for libkvm as it uses filelist. I don't think libkvm is a strong enough case to keep filelist around. I guess I will have to hack it to work similarly to sysctl as well. Do we have an official stance on libkvm? Now that we have sysctl for run-time it's only useful for crashdump debugging. Really in most cases it could be replaced with a reasonable set of gcc scripts. Jeff > > -- > John Baldwin >