All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv4 0/8] Use ticket locks for spinlocks
@ 2015-04-30 15:33 David Vrabel
  2015-04-30 15:33 ` [PATCHv4 1/8] x86: provide arch_fetch_and_add() David Vrabel
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: David Vrabel @ 2015-04-30 15:33 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Tim Deegan,
	David Vrabel, Jan Beulich, Jennifer Herbert

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

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.

We have analysed the affect of this series on interrupt latency (by
measuring the duration of irq disable/enable regions) and there is no
signficant impact.

http://xenbits.xen.org/people/dvrabel/ticket-locks/busy_comp.png

Thanks to Jennifer Herbert for performing this analysis.

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 v4:
- Use new add_sized() to increment ticket head.
- Add arch_lock_acquire_barrier() and arch_lock_release_barrier().
- Rename xadd() to arch_fetch_and_add().
- Shrink struct domain by 16 bytes.

Changes in v3:
- xadd() implementation for arm32 and arm64.
- Add barriers required on arm.
- Only wait for the current lock holder in _spin_barrier().

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] 21+ messages in thread

end of thread, other threads:[~2015-05-11 13:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-30 15:33 [PATCHv4 0/8] Use ticket locks for spinlocks David Vrabel
2015-04-30 15:33 ` [PATCHv4 1/8] x86: provide arch_fetch_and_add() David Vrabel
2015-05-07 15:59   ` Jan Beulich
2015-04-30 15:33 ` [PATCHv4 2/8] arm: " David Vrabel
2015-04-30 15:33 ` [PATCHv4 3/8] x86: provide add_sized() David Vrabel
2015-05-07 16:05   ` Jan Beulich
2015-04-30 15:33 ` [PATCHv4 4/8] arm: " David Vrabel
2015-05-05 13:49   ` Ian Campbell
2015-05-05 13:54     ` Tim Deegan
2015-04-30 15:33 ` [PATCHv4 5/8] xen: use ticket locks for spin locks David Vrabel
2015-05-05 13:56   ` Ian Campbell
2015-05-05 13:58     ` David Vrabel
2015-05-08  9:36   ` Jan Beulich
2015-05-11 13:13     ` David Vrabel
2015-05-11 13:29       ` Tim Deegan
2015-04-30 15:33 ` [PATCHv4 6/8] x86, arm: remove asm/spinlock.h from all architectures David Vrabel
2015-05-05 13:49   ` Ian Campbell
2015-04-30 15:33 ` [PATCHv4 7/8] x86: reduce struct paging_domain size David Vrabel
2015-04-30 15:33 ` [PATCHv4 8/8] x86: reduce struct hvm_domain size David Vrabel
2015-05-08  9:47   ` Jan Beulich
2015-05-11 13:17     ` David Vrabel

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.