Re: [Xen-devel] [PATCHv6 1/3] xen: use ticket locks for spin locks

2015-05-19 Thread Jan Beulich
>>> On 19.05.15 at 12:27, wrote: > On 18/05/15 16:49, Jan Beulich wrote: > On 18.05.15 at 17:33, wrote: >>> On 18/05/15 11:16, Jan Beulich wrote: >>> On 14.05.15 at 13:21, wrote: > void _spin_lock(spinlock_t *lock) > { > +spinlock_tickets_t tickets = { .tail = 1, }; >>>

Re: [Xen-devel] [PATCHv6 1/3] xen: use ticket locks for spin locks

2015-05-19 Thread David Vrabel
On 18/05/15 16:49, Jan Beulich wrote: On 18.05.15 at 17:33, wrote: >> On 18/05/15 11:16, Jan Beulich wrote: >> On 14.05.15 at 13:21, wrote: void _spin_lock(spinlock_t *lock) { +spinlock_tickets_t tickets = { .tail = 1, }; >>> >>> This breaks the build on gcc 4.3.x (d

Re: [Xen-devel] [PATCHv6 1/3] xen: use ticket locks for spin locks

2015-05-18 Thread Jan Beulich
>>> On 18.05.15 at 17:33, wrote: > On 18/05/15 11:16, Jan Beulich wrote: > On 14.05.15 at 13:21, wrote: >>> void _spin_lock(spinlock_t *lock) >>> { >>> +spinlock_tickets_t tickets = { .tail = 1, }; >> >> This breaks the build on gcc 4.3.x (due to tail being a member of an >> unnamed st

Re: [Xen-devel] [PATCHv6 1/3] xen: use ticket locks for spin locks

2015-05-18 Thread David Vrabel
On 18/05/15 11:16, Jan Beulich wrote: On 14.05.15 at 13:21, wrote: >> void _spin_lock(spinlock_t *lock) >> { >> +spinlock_tickets_t tickets = { .tail = 1, }; > > This breaks the build on gcc 4.3.x (due to tail being a member of an > unnamed structure member of a union). I don't have a

Re: [Xen-devel] [PATCHv6 1/3] xen: use ticket locks for spin locks

2015-05-18 Thread Jan Beulich
>>> On 14.05.15 at 13:21, wrote: > void _spin_lock(spinlock_t *lock) > { > +spinlock_tickets_t tickets = { .tail = 1, }; This breaks the build on gcc 4.3.x (due to tail being a member of an unnamed structure member of a union). Jan ___ Xen-deve

Re: [Xen-devel] [PATCHv6 1/3] xen: use ticket locks for spin locks

2015-05-14 Thread Tim Deegan
At 12:21 +0100 on 14 May (1431606100), David Vrabel wrote: > Replace the byte locks with ticket locks. Ticket locks are: a) fair; > and b) peform better when contented since they spin without an atomic > operation. > > The lock is split into two ticket values: head and tail. A locker > acquires

[Xen-devel] [PATCHv6 1/3] xen: use ticket locks for spin locks

2015-05-14 Thread David Vrabel
Replace the byte locks with ticket locks. Ticket locks are: a) fair; and b) peform better when contented since they spin without an atomic operation. The lock is split into two ticket values: head and tail. A locker acquires a ticket by (atomically) increasing tail and using the previous tail va