[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 43/47] Don't sync dirty bitmaps in postcopy
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v3 43/47] Don't sync dirty bitmaps in postcopy |
Date: |
Thu, 28 Aug 2014 16:04:00 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Once we're in postcopy the source processors are stopped and memory
shouldn't change any more, so there's no need to look at the dirty
map.
There are two notes to this:
1) If we do resync and a page had changed then the page would get
sent again, which the destination wouldn't allow (since it might
have also modified the page)
2) Before disabling this I'd seen very rare cases where a page had been
marked dirtied although the memory contents are apparently identical
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
arch_init.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index b449f6d..0694394 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -984,6 +984,7 @@ int64_t ram_mask_postcopy_bitmap(MigrationState *ms)
{
int64_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS;
+ /* This should be our last sync, the src is now paused */
migration_bitmap_sync();
bitmap_and(ms->sentmap, ms->sentmap, migration_bitmap, ram_pages);
return ram_pages;
@@ -1251,7 +1252,10 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
static int ram_save_complete(QEMUFile *f, void *opaque)
{
qemu_mutex_lock_ramlist();
- migration_bitmap_sync();
+
+ if (!migration_postcopy_phase(migrate_get_current())) {
+ migration_bitmap_sync();
+ }
ram_control_before_iterate(f, RAM_CONTROL_FINISH);
@@ -1284,7 +1288,8 @@ static uint64_t ram_save_pending(QEMUFile *f, void
*opaque, uint64_t max_size)
remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE;
- if (remaining_size < max_size) {
+ if (!migration_postcopy_phase(migrate_get_current()) &&
+ remaining_size < max_size) {
qemu_mutex_lock_iothread();
migration_bitmap_sync();
qemu_mutex_unlock_iothread();
--
1.9.3
- [Qemu-devel] [PATCH v3 31/47] postcopy: ram_enable_notify to switch on userfault, (continued)
- [Qemu-devel] [PATCH v3 31/47] postcopy: ram_enable_notify to switch on userfault, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 34/47] mig fd_connect: open return path, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 33/47] Postcopy: Rework migration thread for postcopy mode, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 32/47] Postcopy: postcopy_start, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 36/47] Page request: Add MIG_RPCOMM_REQPAGES reverse command, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 37/47] Page request: Process incoming page request, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 39/47] Add assertion to check migration_dirty_pages, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 38/47] Page request: Consume pages off the post-copy queue, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 41/47] Postcopy: Use helpers to map pages during migration, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 42/47] qemu_ram_block_from_host, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 43/47] Don't sync dirty bitmaps in postcopy,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v3 44/47] Postcopy; Handle userfault requests, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 46/47] postcopy: Wire up loadvm_postcopy_ram_handle_{run, end} commands, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 45/47] Start up a postcopy/listener thread ready for incoming page data, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 47/47] End of migration for postcopy, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 35/47] Postcopy: Create a fault handler thread before marking the ram as userfault, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 40/47] postcopy_ram.c: place_page and helpers, Dr. David Alan Gilbert (git), 2014/08/28
- [Qemu-devel] [PATCH v3 30/47] postcopy: Incoming initialisation, Dr. David Alan Gilbert (git), 2014/08/28