From f9494614898f46e59bc2243de6fb11ebbfc9cda6 Mon Sep 17 00:00:00 2001 From: Alexey Perevalov Date: Thu, 5 Oct 2017 14:13:20 +0300 Subject: migration: add bitmap for received page This patch adds ability to track down already received pages, it's necessary for calculation vCPU block time in postcopy migration feature, and for recovery after postcopy migration failure. Also it's necessary to solve shared memory issue in postcopy livemigration. Information about received pages will be transferred to the software virtual bridge (e.g. OVS-VSWITCHD), to avoid fallocate (unmap) for already received pages. fallocate syscall is required for remmaped shared memory, due to remmaping itself blocks ioctl(UFFDIO_COPY, ioctl in this case will end with EEXIT error (struct page is exists after remmap). Bitmap is placed into RAMBlock as another postcopy/precopy related bitmaps. Reviewed-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Signed-off-by: Alexey Perevalov Signed-off-by: Juan Quintela --- migration/ram.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'migration/ram.h') diff --git a/migration/ram.h b/migration/ram.h index 511b3dc582..f9f7eef894 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -57,4 +57,9 @@ int ram_discard_range(const char *block_name, uint64_t start, size_t length); int ram_postcopy_incoming_init(MigrationIncomingState *mis); void ram_handle_compressed(void *host, uint8_t ch, uint64_t size); + +int ramblock_recv_bitmap_test(RAMBlock *rb, void *host_addr); +void ramblock_recv_bitmap_set(RAMBlock *rb, void *host_addr); +void ramblock_recv_bitmap_set_range(RAMBlock *rb, void *host_addr, size_t nr); + #endif -- cgit v1.2.1