Re: [RFC] Lock free fd lookup

From: Jesse Barnes
Date: Thu Jul 15 2004 - 09:30:43 EST


On Wednesday, July 14, 2004 11:17 am, Chris Wright wrote:
> * Ravikiran G Thirumalai (kiran@xxxxxxxxxx) wrote:
> > This makes use of the lockfree refcounting infrastructure (see earlier
> > posting today) to make files_struct.fd[] lookup lockfree. This is
> > carrying forward work done by Maneesh and Dipankar earlier.
> >
> > With the lockfree fd lookup patch, tiobench performance increases by 13%
> > for sequential reads, 21 % for random reads on a 4 processor pIII xeon.
>
> 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).

It seems to me that RCU is basically rwlocks on steroids, which means that
using it requires the same care to avoid starvation and/or other scalability
problems (i.e. we'd better be really sure that a given codepath really should
be using rwlocks before we change it).

Jesse
-
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/