summary refs log tree commit diff stats
path: root/include/exec/ramblock.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2022-10-04 14:24:29 -0400
committerJuan Quintela <quintela@redhat.com>2022-11-21 11:58:10 +0100
commitcedb70eafb4fd51d9c714981509d97b9f4055be5 (patch)
treea230b94aab982dab7966e935680acd1ac408e229 /include/exec/ramblock.h
parentafed4273b5c9438dfbaa0b4762d0433f295ccdc1 (diff)
downloadfocaccia-qemu-cedb70eafb4fd51d9c714981509d97b9f4055be5.tar.gz
focaccia-qemu-cedb70eafb4fd51d9c714981509d97b9f4055be5.zip
migration: Use non-atomic ops for clear log bitmap
Since we already have bitmap_mutex to protect either the dirty bitmap or
the clear log bitmap, we don't need atomic operations to set/clear/test on
the clear log bitmap.  Switching all ops from atomic to non-atomic
versions, meanwhile touch up the comments to show which lock is in charge.

Introduced non-atomic version of bitmap_test_and_clear_atomic(), mostly the
same as the atomic version but simplified a few places, e.g. dropped the
"old_bits" variable, and also the explicit memory barriers.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/exec/ramblock.h')
-rw-r--r--include/exec/ramblock.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/exec/ramblock.h b/include/exec/ramblock.h
index 6cbedf9e0c..adc03df59c 100644
--- a/include/exec/ramblock.h
+++ b/include/exec/ramblock.h
@@ -53,6 +53,9 @@ struct RAMBlock {
      * and split clearing of dirty bitmap on the remote node (e.g.,
      * KVM).  The bitmap will be set only when doing global sync.
      *
+     * It is only used during src side of ram migration, and it is
+     * protected by the global ram_state.bitmap_mutex.
+     *
      * NOTE: this bitmap is different comparing to the other bitmaps
      * in that one bit can represent multiple guest pages (which is
      * decided by the `clear_bmap_shift' variable below).  On