mirror of https://github.com/xemu-project/xemu.git
migration/multifd: Allow clearing of the file_bmap from multifd
We currently only need to clear the mapped-ram file bitmap from the migration thread during save_zero_page. We're about to add support for zero page detection on the multifd thread, so allow ramblock_set_file_bmap_atomic() to also clear the bits. Signed-off-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20240311180015.3359271-3-hao.xiang@linux.dev Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
44fe138edc
commit
c3cdf3fb18
|
@ -115,7 +115,7 @@ static void multifd_set_file_bitmap(MultiFDSendParams *p)
|
||||||
assert(pages->block);
|
assert(pages->block);
|
||||||
|
|
||||||
for (int i = 0; i < p->pages->num; i++) {
|
for (int i = 0; i < p->pages->num; i++) {
|
||||||
ramblock_set_file_bmap_atomic(pages->block, pages->offset[i]);
|
ramblock_set_file_bmap_atomic(pages->block, pages->offset[i], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3149,9 +3149,13 @@ static void ram_save_file_bmap(QEMUFile *f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ramblock_set_file_bmap_atomic(RAMBlock *block, ram_addr_t offset)
|
void ramblock_set_file_bmap_atomic(RAMBlock *block, ram_addr_t offset, bool set)
|
||||||
{
|
{
|
||||||
set_bit_atomic(offset >> TARGET_PAGE_BITS, block->file_bmap);
|
if (set) {
|
||||||
|
set_bit_atomic(offset >> TARGET_PAGE_BITS, block->file_bmap);
|
||||||
|
} else {
|
||||||
|
clear_bit_atomic(offset >> TARGET_PAGE_BITS, block->file_bmap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -75,7 +75,8 @@ bool ram_dirty_bitmap_reload(MigrationState *s, RAMBlock *rb, Error **errp);
|
||||||
bool ramblock_page_is_discarded(RAMBlock *rb, ram_addr_t start);
|
bool ramblock_page_is_discarded(RAMBlock *rb, ram_addr_t start);
|
||||||
void postcopy_preempt_shutdown_file(MigrationState *s);
|
void postcopy_preempt_shutdown_file(MigrationState *s);
|
||||||
void *postcopy_preempt_thread(void *opaque);
|
void *postcopy_preempt_thread(void *opaque);
|
||||||
void ramblock_set_file_bmap_atomic(RAMBlock *block, ram_addr_t offset);
|
void ramblock_set_file_bmap_atomic(RAMBlock *block, ram_addr_t offset,
|
||||||
|
bool set);
|
||||||
|
|
||||||
/* ram cache */
|
/* ram cache */
|
||||||
int colo_init_ram_cache(void);
|
int colo_init_ram_cache(void);
|
||||||
|
|
Loading…
Reference in New Issue