From owner-freebsd-arch@FreeBSD.ORG Thu May 14 01:58:00 2009 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 0BC54106564A for ; Thu, 14 May 2009 01:58:00 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pz0-f105.google.com (mail-pz0-f105.google.com [209.85.222.105]) by mx1.freebsd.org (Postfix) with ESMTP id DEC578FC22 for ; Thu, 14 May 2009 01:57:59 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by pzk3 with SMTP id 3so456569pzk.3 for ; Wed, 13 May 2009 18:57:59 -0700 (PDT) Received: by 10.114.25.19 with SMTP id 19mr1554400way.89.1242264999287; Wed, 13 May 2009 18:36:39 -0700 (PDT) Received: from ?10.0.1.198? (udp016664uds.hawaiiantel.net [72.235.41.117]) by mx.google.com with ESMTPS id n20sm1521871pof.27.2009.05.13.18.36.37 (version=SSLv3 cipher=RC4-MD5); Wed, 13 May 2009 18:36:38 -0700 (PDT) Date: Wed, 13 May 2009 15:40:01 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: John Baldwin In-Reply-To: <200905130935.42795.jhb@freebsd.org> Message-ID: References: <200905130935.42795.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-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: Thu, 14 May 2009 01:58:00 -0000 On Wed, 13 May 2009, John Baldwin wrote: > On Monday 11 May 2009 11:32:17 pm Jeff Roberson wrote: >> http://people.freebsd.org/~jeff/locklessfd.diff >> >> This patch implements a lockless lookup path for file descriptors. The >> meat of the algorithm is in fget_unlocked(). This returns a referenced >> file descriptor, unlike fget_locked(). In the common case this reduces >> the number of atomics required for fget() while allowing for lookups to >> proceed concurrently with modifications to the table and preventing >> preemption from causing context switches. > > Looks good. My only comment would be to not remove the 'hold' comment > completely from _fget(), but instead say that it always returns a refcount > that must be dropped. Basically: > > * The file's refcount will be bumped on return. It should be dropped > * with fdrop(). > > or something like that in place of the old paragraph about the 'hold' > parameter. Yeah, I think I'll add a comment in the header too. pho has tested it with some targeted tests and stress2 for a day or two. I'm going to commit this evening so it gets as much exposure as possible before release. Thanks, Jeff > > -- > John Baldwin >