aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/bitmap.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/qemu/bitmap.h
parentafed4273b5c9438dfbaa0b4762d0433f295ccdc1 (diff)
downloadqemu-cedb70eafb4fd51d9c714981509d97b9f4055be5.zip
qemu-cedb70eafb4fd51d9c714981509d97b9f4055be5.tar.gz
qemu-cedb70eafb4fd51d9c714981509d97b9f4055be5.tar.bz2
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/qemu/bitmap.h')
-rw-r--r--include/qemu/bitmap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h
index 82a1d2f..3ccb008 100644
--- a/include/qemu/bitmap.h
+++ b/include/qemu/bitmap.h
@@ -253,6 +253,7 @@ void bitmap_set(unsigned long *map, long i, long len);
void bitmap_set_atomic(unsigned long *map, long i, long len);
void bitmap_clear(unsigned long *map, long start, long nr);
bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr);
+bool bitmap_test_and_clear(unsigned long *map, long start, long nr);
void bitmap_copy_and_clear_atomic(unsigned long *dst, unsigned long *src,
long nr);
unsigned long bitmap_find_next_zero_area(unsigned long *map,