aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@suse.de>2024-02-29 12:30:14 -0300
committerPeter Xu <peterx@redhat.com>2024-03-01 15:42:04 +0800
commitf427d90b9898dd7a718b645eeccd9d0ee75d4295 (patch)
tree71f7e5e2468c3a712a19c28c0613224f7fdd4e30 /include
parent9d01778af8e39f5b0f101d0a9f32215717604bef (diff)
downloadqemu-f427d90b9898dd7a718b645eeccd9d0ee75d4295.zip
qemu-f427d90b9898dd7a718b645eeccd9d0ee75d4295.tar.gz
qemu-f427d90b9898dd7a718b645eeccd9d0ee75d4295.tar.bz2
migration/multifd: Support outgoing mapped-ram stream format
The new mapped-ram stream format uses a file transport and puts ram pages in the migration file at their respective offsets and can be done in parallel by using the pwritev system call which takes iovecs and an offset. Add support to enabling the new format along with multifd to make use of the threading and page handling already in place. This requires multifd to stop sending headers and leaving the stream format to the mapped-ram code. When it comes time to write the data, we need to call a version of qio_channel_write that can take an offset. Usage on HMP is: (qemu) stop (qemu) migrate_set_capability multifd on (qemu) migrate_set_capability mapped-ram on (qemu) migrate_set_parameter max-bandwidth 0 (qemu) migrate_set_parameter multifd-channels 8 (qemu) migrate file:migfile Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20240229153017.2221-21-farosas@suse.de Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/bitops.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
index cb3526d..2c0a2fe 100644
--- a/include/qemu/bitops.h
+++ b/include/qemu/bitops.h
@@ -68,6 +68,19 @@ static inline void clear_bit(long nr, unsigned long *addr)
}
/**
+ * clear_bit_atomic - Clears a bit in memory atomically
+ * @nr: Bit to clear
+ * @addr: Address to start counting from
+ */
+static inline void clear_bit_atomic(long nr, unsigned long *addr)
+{
+ unsigned long mask = BIT_MASK(nr);
+ unsigned long *p = addr + BIT_WORD(nr);
+
+ return qatomic_and(p, ~mask);
+}
+
+/**
* change_bit - Toggle a bit in memory
* @nr: Bit to change
* @addr: Address to start counting from