qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Do memory mappings need be rebuilt when deleting ioeventfds?
@ 2014-03-04 10:49 Gonglei (Arei)
  2014-03-04 11:17 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Gonglei (Arei) @ 2014-03-04 10:49 UTC (permalink / raw)
  To: qemu-devel@nongnu.org; +Cc: Paolo Bonzini, Herongguang (Stephen), Juan Quintela

Hi,
  Recently I found that when doing migration on a VM with many Virtio NICs, 
a lot down time was consuming in vm_state_notify(). Further investigation 
shows major consumption is in function memory_region_del_eventfd(). When deletes an 
ioeventfd, in address space transactions commit, it begins with deleting 
all memory mappings in all address spaces, and add each memory mapping again. 
This is time consuming. 

  In my test, each ioeventfd deleing needs about 5ms, within which memory 
mapping rebuilding needs about 4ms. With many Nics and vmchannel in a VM 
doing migrating, there can be many ioeventfds deleting which increasing 
downtime remarkably.

  As far as I can see, memory mappings don't rely on ioeventfds, there is 
no need to destroy and rebuild them when manipulating ioeventfds. I think 
this is for decoupling consideration. Although this simplifies coding and 
design, it scarifies performance.

  So I'd want to know if you have any improve plan on it? Here's my 
assumption: in memory_region_del_eventfd() and memory_region_add_eventfd(), 
we mark that this is a pure ioeventfd operation, so in begin and region_nop 
memory listeners, we eliminate memory mapping destroy and rebuild, thus 
decrease migration down time and improve migration performance.



Best regards,
-Gonglei

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

* Re: [Qemu-devel] Do memory mappings need be rebuilt when deleting ioeventfds?
  2014-03-04 10:49 [Qemu-devel] Do memory mappings need be rebuilt when deleting ioeventfds? Gonglei (Arei)
@ 2014-03-04 11:17 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2014-03-04 11:17 UTC (permalink / raw)
  To: Gonglei (Arei), qemu-devel@nongnu.org
  Cc: Herongguang (Stephen), Juan Quintela

Il 04/03/2014 11:49, Gonglei (Arei) ha scritto:
> Hi,
>   Recently I found that when doing migration on a VM with many Virtio NICs,
> a lot down time was consuming in vm_state_notify(). Further investigation
> shows major consumption is in function memory_region_del_eventfd(). When deletes an
> ioeventfd, in address space transactions commit, it begins with deleting
> all memory mappings in all address spaces, and add each memory mapping again.
> This is time consuming.
>
>   In my test, each ioeventfd deleing needs about 5ms, within which memory
> mapping rebuilding needs about 4ms. With many Nics and vmchannel in a VM
> doing migrating, there can be many ioeventfds deleting which increasing
> downtime remarkably.
>
>   As far as I can see, memory mappings don't rely on ioeventfds, there is
> no need to destroy and rebuild them when manipulating ioeventfds. I think
> this is for decoupling consideration. Although this simplifies coding and
> design, it scarifies performance.
>
>   So I'd want to know if you have any improve plan on it? Here's my
> assumption: in memory_region_del_eventfd() and memory_region_add_eventfd(),
> we mark that this is a pure ioeventfd operation, so in begin and region_nop
> memory listeners, we eliminate memory mapping destroy and rebuild, thus
> decrease migration down time and improve migration performance.

Precisely, what you suggest won't work because you can have 
memory_region_add/del_eventfd as a part of a larger transaction.  But 
overall this is a good idea.

You can split memory_region_update_pending in two parts, like 
memory_region_update_pending and memory_region_ioeventfd_change_pending. 
  Then, if memory_region_update_pending is false but 
memory_region_ioeventfd_change_pending is true, you can activate an 
optimized path.

Paolo

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

end of thread, other threads:[~2014-03-04 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 10:49 [Qemu-devel] Do memory mappings need be rebuilt when deleting ioeventfds? Gonglei (Arei)
2014-03-04 11:17 ` Paolo Bonzini

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).