All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/4] Use ticket locks for spinlocks
@ 2015-04-21 10:11 David Vrabel
  2015-04-21 10:11 ` [PATCHv3 1/4] x86: provide xadd() David Vrabel
                   ` (4 more replies)
  0 siblings, 5 replies; 36+ messages in thread
From: David Vrabel @ 2015-04-21 10:11 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Stefano Stabellini, 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/bar2_comp.png

Interestingly, the biggest offenders for long critical sections are
bare irq disable/enable regions, and some of these are really bad (10s
of ms)!

http://xenbits.xen.org/people/dvrabel/bar_normal_busy.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 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] 36+ messages in thread

end of thread, other threads:[~2015-05-04  7:18 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21 10:11 [PATCHv3 0/4] Use ticket locks for spinlocks David Vrabel
2015-04-21 10:11 ` [PATCHv3 1/4] x86: provide xadd() David Vrabel
2015-04-21 10:36   ` Jan Beulich
2015-04-21 12:36     ` David Vrabel
2015-04-21 13:12       ` Jan Beulich
2015-04-21 13:15         ` David Vrabel
2015-04-21 13:20           ` Jan Beulich
2015-04-21 10:11 ` [PATCHv3 2/4] arm: " David Vrabel
2015-04-21 10:11 ` [PATCHv3 3/4] xen: use ticket locks for spin locks David Vrabel
2015-04-23 11:58   ` Jan Beulich
2015-04-28 15:56     ` David Vrabel
2015-04-28 23:15       ` Jan Beulich
2015-04-29 15:21         ` David Vrabel
2015-04-29 23:56           ` Jan Beulich
2015-04-30 10:09             ` Tim Deegan
2015-04-30 11:55               ` David Vrabel
2015-04-23 12:03   ` Tim Deegan
2015-04-23 13:43     ` David Vrabel
2015-04-23 13:45       ` Andrew Cooper
2015-04-23 14:58         ` Tim Deegan
2015-04-23 14:24       ` Tim Deegan
2015-04-23 14:51         ` Tim Deegan
2015-04-23 13:54     ` Jan Beulich
2015-04-23 14:43       ` Tim Deegan
2015-04-23 14:58         ` Jan Beulich
2015-04-29 15:36           ` David Vrabel
2015-04-29 16:56             ` Tim Deegan
2015-04-29 17:00               ` David Vrabel
2015-04-30  9:00                 ` Tim Deegan
2015-04-29 23:48             ` Jan Beulich
2015-04-21 10:11 ` [PATCHv3 4/4] x86, arm: remove asm/spinlock.h from all architectures David Vrabel
2015-04-21 10:22 ` [PATCHv3 0/4] Use ticket locks for spinlocks Jan Beulich
2015-04-21 11:24   ` Jennifer Herbert
2015-04-23 12:42   ` David Vrabel
2015-04-30 15:44     ` David Vrabel
2015-05-04  7:18       ` 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.