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

Re: [Xen-devel] [PATCHv2 5/6] xen: use ticket locks for spin locks



On 16/04/15 13:03, Tim Deegan wrote:
> 
>> +static int __spin_is_locked(spinlock_t *lock)
>> +{
>> +    return lock->tickets.head != lock->tickets.tail;
>> +}
> 
> Maybe atomic_read the lock and do the comparison on the local value?
> Just from an abundance of caution - can't think of an obvious reason
> why this race should matter.

I think it would be preferable to avoid giving the impression that
avoiding this race is important so I've left this as is (FWIW, the Linux
implementation is like this).

David

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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