Re: [patchset] Lockfree fd lookup 0 of 5

From: Ravikiran G Thirumalai
Date: Tue Aug 03 2004 - 04:25:38 EST


On Mon, Aug 02, 2004 at 05:56:07PM +0100, viro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 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
-
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/