From owner-freebsd-arch@FreeBSD.ORG Wed May 13 00:29:08 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EFA0106564A for ; Wed, 13 May 2009 00:29:08 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.232]) by mx1.freebsd.org (Postfix) with ESMTP id 5DC0B8FC0C for ; Wed, 13 May 2009 00:29:08 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by rv-out-0506.google.com with SMTP id k40so246522rvb.43 for ; Tue, 12 May 2009 17:29:08 -0700 (PDT) Received: by 10.141.106.12 with SMTP id i12mr108956rvm.59.1242174548008; Tue, 12 May 2009 17:29:08 -0700 (PDT) Received: from ?10.0.1.198? (udp016664uds.hawaiiantel.net [72.235.41.117]) by mx.google.com with ESMTPS id l31sm948927rvb.29.2009.05.12.17.29.05 (version=SSLv3 cipher=RC4-MD5); Tue, 12 May 2009 17:29:06 -0700 (PDT) Date: Tue, 12 May 2009 14:32:24 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Ed Schouten In-Reply-To: <20090512165949.GF58540@hoeg.nl> Message-ID: References: <20090512165949.GF58540@hoeg.nl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org Subject: Re: lockless file descriptor lookup 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: Wed, 13 May 2009 00:29:08 -0000 On Tue, 12 May 2009, Ed Schouten wrote: > Hello Jeff, > > * Jeff Roberson wrote: >> Once the file descriptor is resolved, we verify the path via the >> descriptor table once more to ensure that it has not changed. At this >> point, we have a valid reference or we drop an invalid reference and >> retry. > > It's nice to see someone stepped up to implement this. Just out of > curiosity, have you done any benchmarks to see how many percent of the > time a thread needs more than one attempt to obtain a valid reference on > a common workload? > > Maybe it would be nice for diagnostic purposes to add two sysctls to > obtain the amount of successful and unsuccessful attempts. Hi Ed, I have had trouble triggering it at all in testing. I'd prefer not to commit the counters because they would re-introduce a global point of cache contention unless we made them per-cpu. This effectively implements ll/sc semantics on all architectures via cmpset. I suspect the overhead is minimal even in degenerate cases. Thanks, Jeff > > -- > Ed Schouten > WWW: http://80386.nl/ >