Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 May 2009 15:40:01 -1000 (HST)
From:      Jeff Roberson <jroberson@jroberson.net>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: lockless file descriptor lookup
Message-ID:  <alpine.BSF.2.00.0905131539020.981@desktop>
In-Reply-To: <200905130935.42795.jhb@freebsd.org>
References:  <alpine.BSF.2.00.0905111720280.981@desktop> <200905130935.42795.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0905131539020.981>