summaryrefslogtreecommitdiffstats
path: root/include/exec/ram_addr.h
diff options
context:
space:
mode:
authorPeter Xu2019-06-03 08:50:46 +0200
committerJuan Quintela2019-07-15 15:39:02 +0200
commit267691b65cf7167881609dde1e50a4aafd86af08 (patch)
treed1073f21fdecb2edab3913d2d75f78ae5fa9879c /include/exec/ram_addr.h
parentmigration/ram.c: reset complete_round when we gets a queued page (diff)
downloadqemu-267691b65cf7167881609dde1e50a4aafd86af08.tar.gz
qemu-267691b65cf7167881609dde1e50a4aafd86af08.tar.xz
qemu-267691b65cf7167881609dde1e50a4aafd86af08.zip
migration: No need to take rcu during sync_dirty_bitmap
cpu_physical_memory_sync_dirty_bitmap() has one RAMBlock* as parameter, which means that it must be with RCU read lock held already. Taking it again inside seems redundant. Removing it. Instead comment on the functions about the RCU read lock. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20190603065056.25211-2-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/exec/ram_addr.h')
-rw-r--r--include/exec/ram_addr.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index f96777bb99..44dcc98de6 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -409,6 +409,7 @@ static inline void cpu_physical_memory_clear_dirty_range(ram_addr_t start,
}
+/* Called with RCU critical section */
static inline
uint64_t cpu_physical_memory_sync_dirty_bitmap(RAMBlock *rb,
ram_addr_t start,
@@ -432,8 +433,6 @@ uint64_t cpu_physical_memory_sync_dirty_bitmap(RAMBlock *rb,
DIRTY_MEMORY_BLOCK_SIZE);
unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS);
- rcu_read_lock();
-
src = atomic_rcu_read(
&ram_list.dirty_memory[DIRTY_MEMORY_MIGRATION])->blocks;
@@ -453,8 +452,6 @@ uint64_t cpu_physical_memory_sync_dirty_bitmap(RAMBlock *rb,
idx++;
}
}
-
- rcu_read_unlock();
} else {
ram_addr_t offset = rb->offset;