qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Herongguang (Stephen)" <herongguang.he@huawei.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] Do memory mappings need be rebuilt when deleting ioeventfds?
Date: Tue, 04 Mar 2014 12:17:51 +0100	[thread overview]
Message-ID: <5315B65F.8070400@redhat.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020815D4452@SZXEMA503-MBS.china.huawei.com>

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

      reply	other threads:[~2014-03-04 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5315B65F.8070400@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=herongguang.he@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).