Re: [patchset] Lockfree fd lookup 0 of 5

Ravikiran G Thirumalai
2004-08-03T09:24:32Z

On Mon, Aug 02, 2004 at 05:56:07PM +0100, viro@parcelfarce.linux.theplanet.co.uk wrote:
> On Mon, Aug 02, 2004 at 03:40:55PM +0530, Ravikiran G Thirumalai wrote:
> > Here is a patchset to eliminate taking struct files_struct.file_lock on
> > reader side using rcu and rcu based refcounting. These patches
> > extend the kref api to include kref_lf_xxx api and kref_lf_get_rcu to
> > do lockfree refcounting, and use the same. As posted earlier, since fd
> > lookups (struct files_struct.fd[]) will be lock free with these patches,
> > threaded workloads doing lots of io should see performance benefits
> > due to this patchset. I have observed 13-15% improvement with tiobench
> > on a 4 way xeon with this patchset.
>
> How about this for comparison? That's just a dumb "convert to rwlock"
> patch; we can be smarter in e.g. close_on_exec handling, but that's a
> separate story.
>

I ran tiobench on this patch and here is the comparison:

Kernel Seqread Randread Seqwrite Randwrite
--------------------------------------------------------------------------
2.6.7 410.33 234.15 254.39 189.36
rwlocks-viro 401.84 232.69 254.09 194.62
refcount (kref) 455.72 281.75 272.87 230.10

All of this was 2.6.7 based. Nos are througput rates in mega bytes per sec.
Test was on ramfs, 48 threads doing 100 MB of io per thread averaged over
8 runs. This was on a 4 way PIII xeon.

Thanks,
Kiran