qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] virtio-serial-pci very expensive during live migration
@ 2014-05-06 20:01 Chris Friesen
  2014-05-07  5:58 ` Markus Armbruster
  2014-05-07  6:39 ` Paolo Bonzini
  0 siblings, 2 replies; 22+ messages in thread
From: Chris Friesen @ 2014-05-06 20:01 UTC (permalink / raw)
  To: qemu-devel

Hi,

I recently made the unfortunate discovery that virtio-serial-pci is 
quite expensive to stop/start during live migration.

By default we support 32 ports, each of which uses 2 queues.  In my case 
it takes 2-3ms per queue to disconnect on the source host, and another 
2-3ms per queue to connect on the target host, for a total cost of >300ms.

In our case this roughly tripled the outage times of a libvirt-based 
live migration, from 150ms to almost 500ms.

It seems like the main problem is that we loop over all the queues, 
calling virtio_pci_set_host_notifier_internal() on each of them.  That 
in turn calls memory_region_add_eventfd(), which calls 
memory_region_transaction_commit(), which scans over all the address 
spaces, which seems to take the vast majority of the time.

Yes, setting the max_ports value to something smaller does help, but 
each port still adds 10-12ms to the overall live migration time, which 
is crazy.

Is there anything that could be done to make this code more efficient? 
Could we tweak the API so that we add all the eventfds and then do a 
single commit at the end?  Do we really need to scan the entire address 
space?  I don't know the code well enough to answer that sort of 
question, but I'm hoping that one of you does.

Thanks,
Chris

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

end of thread, other threads:[~2014-06-19 15:31 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06 20:01 [Qemu-devel] virtio-serial-pci very expensive during live migration Chris Friesen
2014-05-07  5:58 ` Markus Armbruster
2014-05-07  6:39 ` Paolo Bonzini
2014-05-07 22:25   ` Chris Friesen
2014-05-08 13:02     ` Amit Shah
2014-05-08 13:14       ` Paolo Bonzini
2014-05-08 13:30         ` Amit Shah
2014-05-08 13:36           ` Paolo Bonzini
2014-05-08 13:47             ` Amit Shah
2014-05-08 15:40               ` Chris Friesen
2014-05-09  0:53                 ` Chris Friesen
2014-05-09  8:19                   ` Paolo Bonzini
2014-06-19 15:19                     ` Chris Friesen
2014-06-19 15:31                       ` Paolo Bonzini
2014-05-08 14:31           ` Chris Friesen
2014-05-08 14:34             ` Paolo Bonzini
2014-05-08 15:57               ` Chris Friesen
2014-05-08 16:02                 ` Paolo Bonzini
2014-05-08 20:57                   ` Chris Friesen
2014-05-09  1:44               ` ChenLiang
2014-05-09  3:31                 ` Chris Friesen
2014-05-08  2:54   ` Gonglei (Arei)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).