qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] memory: Fix double unref of flatview
@ 2015-02-12 16:21 Matthew Rosato
  2015-02-12 17:09 ` Paolo Bonzini
  2015-02-12 17:34 ` Paolo Bonzini
  0 siblings, 2 replies; 7+ messages in thread
From: Matthew Rosato @ 2015-02-12 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, famz, borntraeger

Since 374f2981d1 "memory: protect current_map by RCU",
address_space_update_topology unrefs the old_flatview twice,
once by call_rcu and once by direct call.  This patch removes
the direct call in favor of the call_rcu.  Fixes at least one
assertion failure seen in s390, where a ref count for a memory
region attempts to go negative during hot-unplug of guest memory.

Signed-off-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
---
 memory.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/memory.c b/memory.c
index 130152c..d08abe5 100644
--- a/memory.c
+++ b/memory.c
@@ -755,7 +755,6 @@ static void address_space_update_topology(AddressSpace *as)
 
     /* Writes are protected by the BQL.  */
     atomic_rcu_set(&as->current_map, new_view);
-    call_rcu(old_view, flatview_unref, rcu);
 
     /* Note that all the old MemoryRegions are still alive up to this
      * point.  This relieves most MemoryListeners from the need to
@@ -763,7 +762,7 @@ static void address_space_update_topology(AddressSpace *as)
      * outside the iothread mutex, in which case precise reference
      * counting is necessary.
      */
-    flatview_unref(old_view);
+    call_rcu(old_view, flatview_unref, rcu);
 
     address_space_update_ioeventfds(as);
 }
-- 
1.7.9.5

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

end of thread, other threads:[~2015-02-13  9:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-12 16:21 [Qemu-devel] [PATCH] memory: Fix double unref of flatview Matthew Rosato
2015-02-12 17:09 ` Paolo Bonzini
2015-02-12 17:34 ` Paolo Bonzini
2015-02-12 19:32   ` Matthew Rosato
2015-02-12 20:43     ` Paolo Bonzini
2015-02-13  3:29       ` Matthew Rosato
2015-02-13  9:29         ` 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).