Re: [RFC] Lock free fd lookup

From: Chris Wright
Date: Thu Jul 15 2004 - 11:35:11 EST


* Dipankar Sarma (dipankar@xxxxxxxxxx) wrote:
> On Thu, Jul 15, 2004 at 10:22:53AM -0400, Jesse Barnes wrote:
> > On Wednesday, July 14, 2004 11:17 am, Chris Wright wrote:
> > > I'm curious, how much of the performance improvement is from RCU usage
> > > vs. making the basic syncronization primitive aware of a reader and
> > > writer distinction? Do you have benchmark for simply moving to rwlock_t?
> >
> > That's a good point. Also, even though the implementation may be 'lockless',
> > there are still a lot of cachelines bouncing around, whether due to atomic
> > counters or cmpxchg (in fact the latter will be worse than simple atomics).
>
> Chris raises an interesting issue. There are two ways we can benefit from
> lock-free lookup - avoidance of atomic ops in lock acquisition/release
> and avoidance of contention. The latter can also be provided by
> rwlocks in read-mostly situations like this, but rwlock still has
> two atomic ops for acquisition/release. So, in another
> thread, I have suggested looking into the contention angle. IIUC,
> tiobench is threaded and shares fd table.

Given the read heavy assumption that RCU makes (supported by your
benchmarks), I believe that the comparison with RCU vs. current scheme
is unfair. Better comparison is against rwlock_t, which may give a
similar improvement w/out the added complexity. But, I haven't a patch
nor a benchmark, so it's all handwavy at this point.

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/