All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCHv2 0/3]: x86/ept: reduce translation invalidation impact
@ 2015-11-13 18:49 David Vrabel
  2015-11-13 18:49 ` [PATCHv2 1/3] x86/ept: remove unnecessary sync after resolving misconfigured entries David Vrabel
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: David Vrabel @ 2015-11-13 18:49 UTC (permalink / raw)
  To: xen-devel
  Cc: Kevin Tian, Jun Nakajima, George Dunlap, Andrew Cooper,
	Tim Deegan, David Vrabel, Jan Beulich

This RFC series improves the performance of EPT by reducing the impact
of the translation invalidations (ept_sync_domain()).  Two approaches
are used:

a) Removing unnecessary invalidations after fixing misconfigured
   entries (after a type change).

b) Deferring invalidations until the p2m write lock is released.

Prior to this change a 16 VCPU guest could not be successfully
migrated on an (admittedly slow) 160 PCPU box because the p2m write
lock was held for such extended periods of time.  This starved the
read lock needed (by the toolstack) to map the domain's memory,
triggering the watchdog.

After this change a 64 VCPU guest could be successfully migrated.

ept_sync_domain() is very expensive because:

a) it uses on_selected_cpus() and the IPI cost can be particularly
   high for a multi-socket machine.

b) on_selected_cpus() is serialized by its own spin lock.

On this particular box, ept_sync_domain() could take ~3-5 ms.

Simply using a fair rw lock was not sufficient to resolve this (but it
was an improvement) as the cost of the ept_sync_domain calls() was
still delaying the read locks enough for the watchdog to trigger (the
toolstack maps a batch of 1024 GFNs at a time, which means trying to
acquire the p2m read lock 1024 times).

Changes in v2:

- Use a per-p2m (not per-CPU) list for page table pages to be freed.
- Hold the write lock while updating the synced_mask.

David

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

end of thread, other threads:[~2015-12-03 15:59 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 18:49 [RFC PATCHv2 0/3]: x86/ept: reduce translation invalidation impact David Vrabel
2015-11-13 18:49 ` [PATCHv2 1/3] x86/ept: remove unnecessary sync after resolving misconfigured entries David Vrabel
2015-12-02  7:17   ` Tian, Kevin
2015-11-13 18:49 ` [PATCHv2 2/3] mm: don't free pages until mm locks are released David Vrabel
2015-11-16 11:52   ` Jan Beulich
2015-11-16 12:02     ` David Vrabel
2015-11-16 12:04       ` Jan Beulich
2015-11-30 14:10   ` David Vrabel
2015-12-02  7:25   ` Tian, Kevin
2015-12-02 16:23     ` Tim Deegan
2015-12-02 16:30       ` George Dunlap
2015-12-02 16:46         ` Jan Beulich
2015-12-02 16:46         ` Tim Deegan
2015-12-02 17:01           ` George Dunlap
2015-12-02 17:14           ` David Vrabel
2015-12-03 10:22             ` Jan Beulich
2015-12-03 10:56               ` George Dunlap
2015-12-02 16:45       ` David Vrabel
2015-12-02 17:17         ` George Dunlap
2015-11-13 18:49 ` [PATCHv2 3/3] x86/ept: defer the invalidation until the p2m lock is released David Vrabel
2015-12-02  7:14 ` [RFC PATCHv2 0/3]: x86/ept: reduce translation invalidation impact Tian, Kevin
2015-12-03 15:59   ` 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.