Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 May 2009 14:32:24 -1000 (HST)
From:      Jeff Roberson <jroberson@jroberson.net>
To:        Ed Schouten <ed@80386.nl>
Cc:        arch@freebsd.org
Subject:   Re: lockless file descriptor lookup
Message-ID:  <alpine.BSF.2.00.0905121430150.981@desktop>
In-Reply-To: <20090512165949.GF58540@hoeg.nl>
References:  <alpine.BSF.2.00.0905111720280.981@desktop> <20090512165949.GF58540@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 12 May 2009, Ed Schouten wrote:

> Hello Jeff,
>
> * Jeff Roberson <jroberson@jroberson.net> 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 <ed@80386.nl>
> WWW: http://80386.nl/
>



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