All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/6] Use ticket locks for spinlocks
@ 2015-04-10 14:19 David Vrabel
  2015-04-10 14:19 ` [PATCHv2 1/6] x86/hvm: don't include asm/spinlock.h David Vrabel
                   ` (5 more replies)
  0 siblings, 6 replies; 44+ messages in thread
From: David Vrabel @ 2015-04-10 14:19 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Stefano Stabellini, Tim Deegan,
	David Vrabel, Jan Beulich

Use ticket locks for spin locks instead of the current byte locks.
Ticket locks are fair.  This is an important property for hypervisor
locks.

This has the following limitations:

- No ARM optimized xadd() implementation.  The generic implementation
  usign cmpxchg is probably sub-optimal.

Note that spin_lock_irq() and spin_lock_irqsave() now spin with irqs
disabled (previously, they would spin with irqs enabled if possible).
This is required to prevent deadlocks when the irq handler tries to
take the same lock with a higher ticket.

A quick survey of the interrupt disabling spin locks suggests that
this should not introduce significant extra interrupt latency (there
aren't many such locks and I don't think they're heavily contended)
but we are attempting to collect experimental evidence to support
this.

Performance results (using a earlier prototype) of aggregate network
throughput between 20 VIF pairs shows good improvements.

http://xenbits.xen.org/people/dvrabel/3336.png

This benchmark is limited by contention on the map track lock.

Changes in v2:
- Reimplemented in C, requiring only an arch-specific xadd() op
- Optimize spin_lock_recursive() to call spin_lock() since trylock
  loops are bad with ticket locks.

David

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2015-04-21  9:59 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-10 14:19 [PATCHv2 0/6] Use ticket locks for spinlocks David Vrabel
2015-04-10 14:19 ` [PATCHv2 1/6] x86/hvm: don't include asm/spinlock.h David Vrabel
2015-04-10 15:24   ` Andrew Cooper
2015-04-13 13:13     ` David Vrabel
2015-04-13 13:15       ` Andrew Cooper
2015-04-16 11:09   ` Tim Deegan
2015-04-10 14:19 ` [PATCHv2 2/6] x86/mtrr: include asm/atomic.h David Vrabel
2015-04-10 15:25   ` Andrew Cooper
2015-04-16 11:10   ` Tim Deegan
2015-04-10 14:19 ` [PATCHv2 3/6] xen: generic xadd() for ticket locks David Vrabel
2015-04-14 13:17   ` Ian Campbell
2015-04-14 16:37     ` David Vrabel
2015-04-15  8:34       ` Ian Campbell
2015-04-16 11:13   ` Tim Deegan
2015-04-16 15:28   ` Jan Beulich
2015-04-17 12:32     ` Ian Campbell
2015-04-17 12:33       ` Ian Campbell
2015-04-17 12:34       ` David Vrabel
2015-04-17 13:09         ` Ian Campbell
2015-04-17 13:13           ` David Vrabel
2015-04-10 14:19 ` [PATCHv2 4/6] x86: provide xadd() David Vrabel
2015-04-16 11:25   ` Tim Deegan
2015-04-16 11:38     ` David Vrabel
2015-04-16 11:41       ` Tim Deegan
2015-04-16 11:49     ` Jan Beulich
2015-04-16 12:49       ` Tim Deegan
2015-04-16 12:55         ` Ian Campbell
2015-04-16 13:19           ` Jan Beulich
2015-04-16 14:07             ` Ian Campbell
2015-04-16 14:09               ` Ian Campbell
2015-04-16 12:00     ` Ian Campbell
2015-04-10 14:19 ` [PATCHv2 5/6] xen: use ticket locks for spin locks David Vrabel
2015-04-10 15:29   ` Andrew Cooper
2015-04-10 16:44   ` Boris Ostrovsky
2015-04-10 17:29     ` David Vrabel
2015-04-10 17:58       ` Boris Ostrovsky
2015-04-16 12:03   ` Tim Deegan
2015-04-16 12:46     ` David Vrabel
2015-04-16 12:50       ` Tim Deegan
2015-04-16 13:32     ` Jan Beulich
2015-04-21  9:59     ` David Vrabel
2015-04-10 14:19 ` [PATCHv2 6/6] x86, arm: remove asm/spinlock.h from all architectures David Vrabel
2015-04-16 12:51   ` Tim Deegan
2015-04-16 15:29   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.