qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [RFC PATCH qemu] exec: Destroy dispatch immediately
Date: Fri, 25 Aug 2017 11:01:42 +0200	[thread overview]
Message-ID: <256c5d79-d940-3a7c-89e2-19a6140f5ccd@redhat.com> (raw)
In-Reply-To: <20170825083123.47432-1-aik@ozlabs.ru>

On 25/08/2017 10:31, Alexey Kardashevskiy wrote:
> Each address_space_init() updates topology for _every_ address space.

And finally, does this patch help with the above?

diff --git a/memory.c b/memory.c
index c0adc35..97c16cc 100644
--- a/memory.c
+++ b/memory.c
@@ -2607,10 +2607,16 @@ void memory_region_invalidate_mmio_ptr(MemoryRegion *mr, hwaddr offset,
                           RUN_ON_CPU_HOST_PTR(invalidate_data));
 }
 
+static void address_space_rebuild(AddressSpace *as)
+{
+    MEMORY_LISTENER_CALL(as, begin, Forward);
+    address_space_update_topology(as);
+    MEMORY_LISTENER_CALL(as, commit, Forward);
+}
+
 void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name)
 {
     memory_region_ref(root);
-    memory_region_transaction_begin();
     as->ref_count = 1;
     as->root = root;
     as->malloced = false;
@@ -2622,8 +2628,7 @@ void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name)
     QTAILQ_INSERT_TAIL(&address_spaces, as, address_spaces_link);
     as->name = g_strdup(name ? name : "anonymous");
     address_space_init_dispatch(as);
-    memory_region_update_pending |= root->enabled;
-    memory_region_transaction_commit();
+    address_space_rebuild(as);
 }
 
 static void do_address_space_destroy(AddressSpace *as)


Completely untested because vacation is coming.

Thanks,

Paolo

  parent reply	other threads:[~2017-08-25  9:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  5:39 [Qemu-devel] Memory use with >100 virtio devices Alexey Kardashevskiy
2017-08-18 13:18 ` Stefan Hajnoczi
2017-08-21  4:31   ` David Gibson
2017-08-21  5:50     ` Alexey Kardashevskiy
2017-08-24  9:48       ` Alexey Kardashevskiy
2017-08-24 12:30         ` David Gibson
2017-08-25  8:31           ` [Qemu-devel] [RFC PATCH qemu] exec: Destroy dispatch immediately Alexey Kardashevskiy
2017-08-25  8:53             ` Paolo Bonzini
2017-08-25  9:22               ` Peter Maydell
2017-08-25  9:57                 ` Paolo Bonzini
2017-08-25 13:19                   ` David Gibson
2017-08-25 13:46                     ` Peter Maydell
2017-08-25 14:04                     ` Paolo Bonzini
2017-08-29  8:55               ` Alexey Kardashevskiy
2017-08-25  8:55             ` Paolo Bonzini
2017-08-25  9:01             ` Paolo Bonzini [this message]
2017-08-25  9:16               ` Alexey Kardashevskiy
2017-08-25  9:58                 ` Paolo Bonzini
2017-08-25 10:48           ` [Qemu-devel] Memory use with >100 virtio devices Paolo Bonzini

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=256c5d79-d940-3a7c-89e2-19a6140f5ccd@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    /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).