[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] switch rangeset's lock to rwlock



>>> On 25.03.11 at 18:08, Keir Fraser <keir.xen@xxxxxxxxx> wrote:
> I'd rather get rid of rwlocks altogether and use RCU in any cases where we
> really have contention. Rwlocks don't help unless the read-side critical
> sections are large enough to amortise the cache ping-pong cost of the
> locking/unlocking operations. And in Xen we have very few if any
> significantly sized critical sections.

As I said in the description, the rangeset code is of general library
kind, and hence shouldn't make assumptions on the sort of data
stored in rangesets. While I agree that in many cases the read
side critical section would be small, there can be exceptions.

Using RCU in this kind of a leaf, independent of almost anything
else library routine would seem odd.

The only reason to stay with spinlocks was imo if you indeed
wanted to knock off rwlocks altogether, which would new seem
contrary to your c/s 23099:612171ff82ea.

> I need to double check, but I believe we have only a couple of rwlock users
> now, and none of the read-side critical sections are large, so in that case
> I suggest we switch them to use spinlocks and kill our rwlock
> implementation.

Indeed, there's only tmem without the two patches I had sent. One
of the reasons for putting them together was to actually have some
*active* users of rwlocks again, so the code wouldn't have too good
chances to bit-rot.

Further, I've taken note of a few other locks that may be
candidates for conversion to rwlocks (pcidevs_lock being the
most prominent example), requiring closer inspection and possibly
code adjustments other than the mere lock kind conversion.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.