From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com, amit.shah@redhat.com
Cc: aarcange@redhat.com, pbonzini@redhat.com, liang.z.li@intel.com,
luis@cs.umu.se, bharata@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH v8 00/54] Postcopy implementation
Date: Tue, 29 Sep 2015 09:37:24 +0100 [thread overview]
Message-ID: <1443515898-3594-1-git-send-email-dgilbert@redhat.com> (raw)
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
This is the 8th cut of my version of postcopy.
The userfaultfd linux kernel code is now in the upstream kernel
tree, and so 4.3-rc3 can be used without modification.
This qemu series can be found at:
https://github.com/orbitfp7/qemu.git
on the wp3-postcopy-v8 tag
Testing status:
* Tested heavily on x86
* Smoke tested on aarch64 (so it does work on different page sizes)
* Power is unhappy for me (but gets further than the htab problem
v7 used to have) (I get a kvm run failed)
Note that patches:
3 Init page size in qtest
10 Use RAMBlock rather than Memory Region
14,15 (splitting ram find and save block)
36 Split out end of migration code
have also been posted seperately during the last month and
can be taken separately from this series.
This work has been partially funded by the EU Orbit project:
see http://www.orbitproject.eu/about/
v8
Huge page changes
The precopy phase is now allowed to keep transparent-huge-pages
enabled, although these maybe split in the discard phase. A change
to the discard process now causes discards for unsent (as well as
redirtied) pages; the combination of these changes means that the
destination starts running with many of the precopy pages as huge
pages, resulting in a significant performance benefit. This change
adds one more state ('discard') which is entered by the destination
on reception of the 1st discard command.
Add global_state_store for postcopy
Moved postcopy_state back out of MigrationIncomingState
During the end of the main migration thread reading state the
postcopy state is read to see who should cleanup; in failure
conditions there was a race between the state being read and the
freeing of the MIS
Stop calling the iterate method for non-postcopiable devices during postcopy
Helps fix Power (thanks for Bharata for helping debug this)
Review comment fixes
rework of migration command parsing
rework of postcopy_chunk_hostpages
rework of discard code & protocol into start/length rather than start/end
rename qemu_get_buffer_less_copy -> qemu_get_buffer_in_place
split 'Postcopy end in migration thread' patch into two
split of MIG_RP_MSG_REQ_PAGES into subtype with name
Added comments documenting postcopy_state's use
lots of other minor fixups
Notes:
I kept the mlock support (users are saying they wanted migration/postcopy
with mlock)
I'm keeping the x- for now, until the libvirt interface gets finalised.
There are two checkpatch errors, that I don't think are right to change:
a) a 'typedef enum' it wants split - that's the way we do all our enums
and would force a dummy name for the enum.
b) A complaint about postcopy_ram_discard_version = 0 that's a global
static; I could get rid of it by making my version 1, but it doesn't
seem right to omit the '= 0 ' for a version constant.
Dave
Dr. David Alan Gilbert (54):
Add postcopy documentation
Provide runtime Target page information
Init page sizes in qtest
Move configuration section writing
qemu_ram_block_from_host
Rename mis->file to from_src_file
Add qemu_get_buffer_in_place to avoid copies some of the time
Add wrapper for setting blocking status on a QEMUFile
Add QEMU_MADV_NOHUGEPAGE
migration/ram.c: Use RAMBlock rather than MemoryRegion
ram_debug_dump_bitmap: Dump a migration bitmap as text
migrate_init: Call from savevm
Move dirty page search state into separate structure
ram_find_and_save_block: Split out the finding
Rename save_live_complete to save_live_complete_precopy
Return path: Open a return path on QEMUFile for sockets
Return path: socket_writev_buffer: Block even on non-blocking fd's
Migration commands
Return path: Control commands
Return path: Send responses from destination to source
Return path: Source handling of return path
Rework loadvm path for subloops
Add migration-capability boolean for postcopy-ram.
Add wrappers and handlers for sending/receiving the postcopy-ram
migration messages.
MIG_CMD_PACKAGED: Send a packaged chunk of migration stream
Modify save_live_pending for postcopy
postcopy: OS support test
migrate_start_postcopy: Command to trigger transition to postcopy
MIGRATION_STATUS_POSTCOPY_ACTIVE: Add new migration state
Avoid sending vmdescription during postcopy
Add qemu_savevm_state_complete_postcopy
Postcopy: Maintain sentmap and calculate discard
postcopy: Incoming initialisation
postcopy: ram_enable_notify to switch on userfault
Postcopy: Postcopy startup in migration thread
Split out end of migration code from migration_thread
Postcopy: End of iteration
Page request: Add MIG_RP_MSG_REQ_PAGES reverse command
Page request: Process incoming page request
Page request: Consume pages off the post-copy queue
postcopy_ram.c: place_page and helpers
Postcopy: Use helpers to map pages during migration
Don't sync dirty bitmaps in postcopy
Don't iterate on precopy-only devices during postcopy
Host page!=target page: Cleanup bitmaps
postcopy: Check order of received target pages
Round up RAMBlock sizes to host page sizes
Postcopy; Handle userfault requests
Start up a postcopy/listener thread ready for incoming page data
postcopy: Wire up loadvm_postcopy_handle_ commands
Postcopy: Mark nohugepage before discard
End of migration for postcopy
Disable mlock around incoming postcopy
Inhibit ballooning during postcopy
balloon.c | 11 +
docs/migration.txt | 191 ++++++++
exec.c | 72 ++-
hmp-commands.hx | 15 +
hmp.c | 7 +
hmp.h | 1 +
hw/ppc/spapr.c | 2 +-
hw/virtio/virtio-balloon.c | 4 +-
include/exec/cpu-common.h | 3 +
include/exec/ram_addr.h | 2 -
include/migration/migration.h | 128 ++++-
include/migration/postcopy-ram.h | 99 ++++
include/migration/qemu-file.h | 10 +
include/migration/vmstate.h | 8 +-
include/qemu/osdep.h | 9 +
include/qemu/typedefs.h | 3 +
include/sysemu/balloon.h | 2 +
include/sysemu/sysemu.h | 46 +-
migration/Makefile.objs | 2 +-
migration/block.c | 9 +-
migration/migration.c | 753 +++++++++++++++++++++++++++--
migration/postcopy-ram.c | 763 ++++++++++++++++++++++++++++++
migration/qemu-file-unix.c | 111 ++++-
migration/qemu-file.c | 74 +++
migration/ram.c | 995 +++++++++++++++++++++++++++++++++++----
migration/savevm.c | 825 ++++++++++++++++++++++++++++----
qapi-schema.json | 18 +-
qmp-commands.hx | 19 +
qtest.c | 1 +
trace-events | 81 +++-
30 files changed, 3996 insertions(+), 268 deletions(-)
create mode 100644 include/migration/postcopy-ram.h
create mode 100644 migration/postcopy-ram.c
--
2.5.0
next reply other threads:[~2015-09-29 8:38 UTC|newest]
Thread overview: 126+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 8:37 Dr. David Alan Gilbert (git) [this message]
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 01/54] Add postcopy documentation Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 02/54] Provide runtime Target page information Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 03/54] Init page sizes in qtest Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 04/54] Move configuration section writing Dr. David Alan Gilbert (git)
2015-10-05 6:44 ` Amit Shah
2015-10-30 12:47 ` Dr. David Alan Gilbert
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 05/54] qemu_ram_block_from_host Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 06/54] Rename mis->file to from_src_file Dr. David Alan Gilbert (git)
2015-09-29 10:41 ` Amit Shah
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 07/54] Add qemu_get_buffer_in_place to avoid copies some of the time Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 08/54] Add wrapper for setting blocking status on a QEMUFile Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 09/54] Add QEMU_MADV_NOHUGEPAGE Dr. David Alan Gilbert (git)
2015-10-28 10:35 ` Amit Shah
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 10/54] migration/ram.c: Use RAMBlock rather than MemoryRegion Dr. David Alan Gilbert (git)
2015-10-28 10:36 ` Amit Shah
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 11/54] ram_debug_dump_bitmap: Dump a migration bitmap as text Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 12/54] migrate_init: Call from savevm Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 13/54] Move dirty page search state into separate structure Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 14/54] ram_find_and_save_block: Split out the finding Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 15/54] Rename save_live_complete to save_live_complete_precopy Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 16/54] Return path: Open a return path on QEMUFile for sockets Dr. David Alan Gilbert (git)
2015-10-02 15:29 ` Daniel P. Berrange
2015-10-02 16:32 ` Dr. David Alan Gilbert
2015-10-02 17:03 ` Daniel P. Berrange
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 17/54] Return path: socket_writev_buffer: Block even on non-blocking fd's Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 18/54] Migration commands Dr. David Alan Gilbert (git)
2015-10-20 11:22 ` Juan Quintela
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 19/54] Return path: Control commands Dr. David Alan Gilbert (git)
2015-10-20 11:27 ` Juan Quintela
2015-10-26 11:42 ` Dr. David Alan Gilbert
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 20/54] Return path: Send responses from destination to source Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 21/54] Return path: Source handling of return path Dr. David Alan Gilbert (git)
2015-10-20 11:33 ` Juan Quintela
2015-10-26 12:06 ` Dr. David Alan Gilbert
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 22/54] Rework loadvm path for subloops Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 23/54] Add migration-capability boolean for postcopy-ram Dr. David Alan Gilbert (git)
2015-09-29 20:22 ` Eric Blake
2015-09-30 7:00 ` Amit Shah
2015-09-30 12:44 ` Eric Blake
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 24/54] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages Dr. David Alan Gilbert (git)
2015-10-20 11:50 ` Juan Quintela
2015-10-26 12:22 ` Dr. David Alan Gilbert
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 25/54] MIG_CMD_PACKAGED: Send a packaged chunk of migration stream Dr. David Alan Gilbert (git)
2015-10-20 13:25 ` Juan Quintela
2015-10-26 16:21 ` Dr. David Alan Gilbert
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 26/54] Modify save_live_pending for postcopy Dr. David Alan Gilbert (git)
2015-10-28 11:03 ` Amit Shah
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 27/54] postcopy: OS support test Dr. David Alan Gilbert (git)
2015-10-20 13:31 ` Juan Quintela
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 28/54] migrate_start_postcopy: Command to trigger transition to postcopy Dr. David Alan Gilbert (git)
2015-09-30 16:25 ` Eric Blake
2015-09-30 16:30 ` Dr. David Alan Gilbert
2015-10-20 13:33 ` Juan Quintela
2015-10-28 11:17 ` Amit Shah
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 29/54] MIGRATION_STATUS_POSTCOPY_ACTIVE: Add new migration state Dr. David Alan Gilbert (git)
2015-10-20 13:35 ` Juan Quintela
2015-10-30 18:19 ` Dr. David Alan Gilbert
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 30/54] Avoid sending vmdescription during postcopy Dr. David Alan Gilbert (git)
2015-10-20 13:35 ` Juan Quintela
2015-10-28 11:19 ` Amit Shah
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 31/54] Add qemu_savevm_state_complete_postcopy Dr. David Alan Gilbert (git)
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 32/54] Postcopy: Maintain sentmap and calculate discard Dr. David Alan Gilbert (git)
2015-10-21 11:17 ` Juan Quintela
2015-10-30 18:43 ` Dr. David Alan Gilbert
2015-11-02 17:31 ` Dr. David Alan Gilbert
2015-11-02 18:19 ` Dr. David Alan Gilbert
2015-11-02 20:14 ` Dr. David Alan Gilbert
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 33/54] postcopy: Incoming initialisation Dr. David Alan Gilbert (git)
2015-10-21 8:35 ` Juan Quintela
2015-11-03 17:59 ` Dr. David Alan Gilbert
2015-11-03 18:32 ` Juan Quintela
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 34/54] postcopy: ram_enable_notify to switch on userfault Dr. David Alan Gilbert (git)
2015-10-28 11:40 ` Amit Shah
2015-09-29 8:37 ` [Qemu-devel] [PATCH v8 35/54] Postcopy: Postcopy startup in migration thread Dr. David Alan Gilbert (git)
2015-10-21 8:57 ` Juan Quintela
2015-10-26 17:12 ` Dr. David Alan Gilbert
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 36/54] Split out end of migration code from migration_thread Dr. David Alan Gilbert (git)
2015-10-21 9:11 ` Juan Quintela
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 37/54] Postcopy: End of iteration Dr. David Alan Gilbert (git)
2015-10-21 9:16 ` Juan Quintela
2015-10-29 5:10 ` Amit Shah
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 38/54] Page request: Add MIG_RP_MSG_REQ_PAGES reverse command Dr. David Alan Gilbert (git)
2015-10-21 11:12 ` Juan Quintela
2015-10-26 16:58 ` Dr. David Alan Gilbert
2015-10-29 5:17 ` Amit Shah
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 39/54] Page request: Process incoming page request Dr. David Alan Gilbert (git)
2015-10-21 11:17 ` Juan Quintela
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 40/54] Page request: Consume pages off the post-copy queue Dr. David Alan Gilbert (git)
2015-10-26 16:32 ` Juan Quintela
2015-11-03 11:52 ` Dr. David Alan Gilbert
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 41/54] postcopy_ram.c: place_page and helpers Dr. David Alan Gilbert (git)
2015-10-28 10:28 ` Juan Quintela
2015-10-28 13:11 ` Dr. David Alan Gilbert
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 42/54] Postcopy: Use helpers to map pages during migration Dr. David Alan Gilbert (git)
2015-10-28 10:58 ` Juan Quintela
2015-10-30 12:59 ` Dr. David Alan Gilbert
2015-10-30 16:35 ` Dr. David Alan Gilbert
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 43/54] Don't sync dirty bitmaps in postcopy Dr. David Alan Gilbert (git)
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 44/54] Don't iterate on precopy-only devices during postcopy Dr. David Alan Gilbert (git)
2015-10-28 11:01 ` Juan Quintela
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 45/54] Host page!=target page: Cleanup bitmaps Dr. David Alan Gilbert (git)
2015-10-28 11:24 ` Juan Quintela
2015-11-03 17:32 ` Dr. David Alan Gilbert
2015-11-03 18:30 ` Juan Quintela
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 46/54] postcopy: Check order of received target pages Dr. David Alan Gilbert (git)
2015-10-28 11:26 ` Juan Quintela
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 47/54] Round up RAMBlock sizes to host page sizes Dr. David Alan Gilbert (git)
2015-10-28 11:28 ` Juan Quintela
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 48/54] Postcopy; Handle userfault requests Dr. David Alan Gilbert (git)
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 49/54] Start up a postcopy/listener thread ready for incoming page data Dr. David Alan Gilbert (git)
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 50/54] postcopy: Wire up loadvm_postcopy_handle_ commands Dr. David Alan Gilbert (git)
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 51/54] Postcopy: Mark nohugepage before discard Dr. David Alan Gilbert (git)
2015-10-28 14:02 ` Juan Quintela
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 52/54] End of migration for postcopy Dr. David Alan Gilbert (git)
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 53/54] Disable mlock around incoming postcopy Dr. David Alan Gilbert (git)
2015-10-21 9:17 ` Juan Quintela
2015-09-29 8:38 ` [Qemu-devel] [PATCH v8 54/54] Inhibit ballooning during postcopy Dr. David Alan Gilbert (git)
[not found] <1443459153-10965-1-git-send-email-dgilbert@redhat.com>
2015-09-30 10:25 ` [Qemu-devel] [PATCH v8 00/54] Postcopy implementation Bharata B Rao
2015-09-30 10:53 ` Dr. David Alan Gilbert
2015-09-30 14:28 ` Bharata B Rao
2015-09-30 16:14 ` Dr. David Alan Gilbert
2015-10-01 3:04 ` Bharata B Rao
2015-10-02 9:03 ` Dr. David Alan Gilbert
2015-10-05 4:38 ` Bharata B Rao
2015-10-05 9:34 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443515898-3594-1-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=aarcange@redhat.com \
--cc=amit.shah@redhat.com \
--cc=bharata@linux.vnet.ibm.com \
--cc=liang.z.li@intel.com \
--cc=luis@cs.umu.se \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).