]> Git Repo - qemu.git/commitdiff
migration: No need to take rcu during sync_dirty_bitmap
authorPeter Xu <[email protected]>
Mon, 3 Jun 2019 06:50:46 +0000 (14:50 +0800)
committerJuan Quintela <[email protected]>
Mon, 15 Jul 2019 13:39:02 +0000 (15:39 +0200)
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 <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Signed-off-by: Peter Xu <[email protected]>
Message-Id: <20190603065056[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
include/exec/ram_addr.h
migration/ram.c

index f96777bb992198f1952d7c08849eceb2d3edf6dd..44dcc98de6cbc352c1a1e120aa71b9abd3da4fa0 100644 (file)
@@ -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;
 
index 89eec7ee9dc33260c4949232209170a831de4cfb..48969db84b45a33172ed18c7d59a0c9e90f95116 100644 (file)
@@ -1674,6 +1674,7 @@ static inline bool migration_bitmap_clear_dirty(RAMState *rs,
     return ret;
 }
 
+/* Called with RCU critical section */
 static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb,
                                         ram_addr_t length)
 {
This page took 0.026982 seconds and 4 git commands to generate.