Re: [Xen-devel] [PATCHv3 2/2] spinlock: fair read-write locks

2016-02-03 Thread Jan Beulich
>>> On 03.02.16 at 12:57, wrote: > On 03/02/16 11:28, Jan Beulich wrote: > On 01.02.16 at 12:31, wrote: >>> +void queue_write_lock_slowpath(rwlock_t *lock) >>> +{ >>> +u32 cnts; >>> + >>> +/* Put the writer into the wait queue. */ >>> +spin_lock(&lock->lock); >>> + >>> +/* Try

Re: [Xen-devel] [PATCHv3 2/2] spinlock: fair read-write locks

2016-02-03 Thread David Vrabel
On 03/02/16 11:28, Jan Beulich wrote: On 01.02.16 at 12:31, wrote: >> +void queue_write_lock_slowpath(rwlock_t *lock) >> +{ >> +u32 cnts; >> + >> +/* Put the writer into the wait queue. */ >> +spin_lock(&lock->lock); >> + >> +/* Try to acquire the lock directly if no reader is

Re: [Xen-devel] [PATCHv3 2/2] spinlock: fair read-write locks

2016-02-03 Thread Jan Beulich
>>> On 01.02.16 at 12:31, wrote: > +void queue_write_lock_slowpath(rwlock_t *lock) > +{ > +u32 cnts; > + > +/* Put the writer into the wait queue. */ > +spin_lock(&lock->lock); > + > +/* Try to acquire the lock directly if no reader is present. */ > +if ( !atomic_read(&lock->cn