[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 4/7] memory: Fold memory_region_update_topology i
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v2 4/7] memory: Fold memory_region_update_topology into memory_region_transaction_commit |
Date: |
Wed, 27 Jun 2012 18:27:26 +0200 |
Simplify the code as we are using now only a subset of the original
features of memory_region_update_topology.
Signed-off-by: Jan Kiszka <address@hidden>
---
memory.c | 39 +++++++++++----------------------------
1 files changed, 11 insertions(+), 28 deletions(-)
diff --git a/memory.c b/memory.c
index 8b1218e..902a8c1 100644
--- a/memory.c
+++ b/memory.c
@@ -24,7 +24,6 @@
#include "exec-obsolete.h"
unsigned memory_region_transaction_depth = 0;
-static bool memory_region_update_pending = false;
static bool global_dirty_log = false;
static QTAILQ_HEAD(memory_listeners, MemoryListener) memory_listeners
@@ -732,31 +731,6 @@ static void address_space_update_topology(AddressSpace *as)
address_space_update_ioeventfds(as);
}
-static void memory_region_update_topology(MemoryRegion *mr)
-{
- if (memory_region_transaction_depth) {
- memory_region_update_pending |= !mr || mr->enabled;
- return;
- }
-
- if (mr && !mr->enabled) {
- return;
- }
-
- MEMORY_LISTENER_CALL_GLOBAL(begin, Forward);
-
- if (address_space_memory.root) {
- address_space_update_topology(&address_space_memory);
- }
- if (address_space_io.root) {
- address_space_update_topology(&address_space_io);
- }
-
- MEMORY_LISTENER_CALL_GLOBAL(commit, Forward);
-
- memory_region_update_pending = false;
-}
-
void memory_region_transaction_begin(void)
{
++memory_region_transaction_depth;
@@ -766,8 +740,17 @@ void memory_region_transaction_commit(void)
{
assert(memory_region_transaction_depth);
--memory_region_transaction_depth;
- if (!memory_region_transaction_depth && memory_region_update_pending) {
- memory_region_update_topology(NULL);
+ if (!memory_region_transaction_depth) {
+ MEMORY_LISTENER_CALL_GLOBAL(begin, Forward);
+
+ if (address_space_memory.root) {
+ address_space_update_topology(&address_space_memory);
+ }
+ if (address_space_io.root) {
+ address_space_update_topology(&address_space_io);
+ }
+
+ MEMORY_LISTENER_CALL_GLOBAL(commit, Forward);
}
}
--
1.7.3.4
- [Qemu-devel] [PATCH v2 0/7] kvm: Get coalesced MMIO flushing out of the hot-path, Jan Kiszka, 2012/06/27
- [Qemu-devel] [PATCH v2 1/7] i82378: Remove bogus MMIO coalescing, Jan Kiszka, 2012/06/27
- [Qemu-devel] [PATCH v2 2/7] memory: Flush coalesced MMIO on selected region access, Jan Kiszka, 2012/06/27
- [Qemu-devel] [PATCH v2 6/7] VGA: Flush coalesced MMIO on related MMIO/PIO accesses, Jan Kiszka, 2012/06/27
- [Qemu-devel] [PATCH v2 5/7] memory: Flush coalesced MMIO on mapping and state changes, Jan Kiszka, 2012/06/27
- [Qemu-devel] [PATCH v2 4/7] memory: Fold memory_region_update_topology into memory_region_transaction_commit,
Jan Kiszka <=
- [Qemu-devel] [PATCH v2 3/7] memory: Use transaction_begin/commit also for single-step operations, Jan Kiszka, 2012/06/27
- [Qemu-devel] [PATCH v2 7/7] kvm: Stop flushing coalesced MMIO on vmexit, Jan Kiszka, 2012/06/27
- Re: [Qemu-devel] [PATCH v2 0/7] kvm: Get coalesced MMIO flushing out of the hot-path, Avi Kivity, 2012/06/28