qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/47] Postcopy implementation
@ 2014-08-28 15:03 Dr. David Alan Gilbert (git)
  2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 01/47] QEMUSizedBuffer/QEMUFile Dr. David Alan Gilbert (git)
                   ` (46 more replies)
  0 siblings, 47 replies; 52+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2014-08-28 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: aarcange, yamahata, amit.shah, lilei, quintela

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Hi,
  This is the 3rd cut of my postcopy implementation.  

The two largest changes since V2 are:
    * The source side return path handler is now a thread, and that
      allows the source side fd to be blocking.  (I'm using shutdown(2)
      to make that thread joinable at the end).  I've not changed the
      destination side yet, I'm still concerned that we could end
      up blocking the HMP/QMP if we're not careful.

    * The dirty bitmaps are no longer sync'ed after we switch into postcopy
      We no longer need to do it, because in principal nothing should change,
      and indeed if it does change, the dirtying caused the page to be resent
      and the destination would reject it (as it should since it can have been
      changing itself).  In practice I'm seeing occasional cases where dirtying
      was happening, I'm suspecting this might be related to the networking
      code still being live (see the current patches on the list to stop that)
      but I haven't dug too deep on this.

There are also a bunch of other fixes:
  Docs update (Paolo's comments, and Eric's)
  postcopy test: fix error path (zhanghailiang's comment)
  More clean up of exit cases; a lot less TODO's
  More bisectable - but not there yet

I've also included the QEMUSizedBuffer/QEMUFile patches in this set for those
who want to patch from the mail; but still intend to update them separately.

      
This code is also now in a public GIT repo; see

https://github.com/orbitfp7/qemu/tree/wp3-postcopy

This version is tag: wp3-postcopy-v3 on the wp3-postcopy branch.

Postcopy requires the kernel modifications from Andrea posted here:
  http://lists.gnu.org/archive/html/qemu-devel/2014-07/msg00525.html

Current TODO:
   1) It's not bisectable yet
   2) There are no testsuite additions (although I have a virt-test modification
      I've been using).
   3) Not all the code is there for systems with hostpagesize!=qemupagesize
   4) xbzrle needs disabling once in postcopy
   5) RDMA needs some rework
   6) The latency measurements are now pretty consistent, no very large spikes,
      but they're a bit higher than expected, I need to look at rate limiting
      just the background scan.
   7) Conversion of destination side return-path to blocking fd needs investigation
      (as per discussion with Paolo)
   8) Andrea has suggestions on ways to avoid some of the huge-page splitting
      that occurs during the discard phase after precopy.
   9) I'd like to format the data on the return path in a more structured way
      (i.e. maybe using stuff from my BER world).
  10) The ACPI fix in 2.1 that allowed migrating RAMBlocks to be larger than
      the source feels like it needs looking at for postcopy.
  11) I've got an occasional (1/100 ~ 1/500ish) failure on migration of idle VMs

Dave



Dr. David Alan Gilbert (47):
  QEMUSizedBuffer/QEMUFile
  Tests: QEMUSizedBuffer/QEMUBuffer
  Start documenting how postcopy works.
  qemu_ram_foreach_block: pass up error value, and down the ramblock
    name
  improve DPRINTF macros, add to savevm
  Add qemu_get_counted_string to read a string prefixed by a count byte
  Create MigrationIncomingState
  socket shutdown
  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
  qemu_loadvm errors and debug
  ram_debug_dump_bitmap: Dump a migration bitmap as text
  Rework loadvm path for subloops
  Add migration-capability boolean for postcopy-ram.
  Add wrappers and handlers for sending/receiving the postcopy-ram
    migration messages.
  QEMU_VM_CMD_PACKAGED: Send a packaged chunk of migration stream
  migrate_init: Call from savevm
  Allow savevm handlers to state whether they could go into postcopy
  postcopy: OS support test
  migrate_start_postcopy: Command to trigger transition to postcopy
  MIG_STATE_POSTCOPY_ACTIVE: Add new migration state
  qemu_savevm_state_complete: Postcopy changes
  Postcopy: Maintain sentmap during postcopy pre phase
  Postcopy page-map-incoming (PMI) structure
  postcopy: Add incoming_init/cleanup functions
  postcopy: Incoming initialisation
  postcopy: ram_enable_notify to switch on userfault
  Postcopy: postcopy_start
  Postcopy: Rework migration thread for postcopy mode
  mig fd_connect: open return path
  Postcopy: Create a fault handler thread before marking the ram as
    userfault
  Page request:  Add MIG_RPCOMM_REQPAGES reverse command
  Page request: Process incoming page request
  Page request: Consume pages off the post-copy queue
  Add assertion to check migration_dirty_pages
  postcopy_ram.c: place_page and helpers
  Postcopy: Use helpers to map pages during migration
  qemu_ram_block_from_host
  Don't sync dirty bitmaps in postcopy
  Postcopy; Handle userfault requests
  Start up a postcopy/listener thread ready for incoming page data
  postcopy: Wire up loadvm_postcopy_ram_handle_{run,end} commands
  End of migration for postcopy

 Makefile.objs                    |   2 +-
 arch_init.c                      | 499 +++++++++++++++++++--
 docs/migration.txt               | 188 ++++++++
 exec.c                           |  66 ++-
 hmp-commands.hx                  |  15 +
 hmp.c                            |   7 +
 hmp.h                            |   1 +
 include/exec/cpu-common.h        |   8 +-
 include/migration/migration.h    | 127 ++++++
 include/migration/postcopy-ram.h |  89 ++++
 include/migration/qemu-file.h    |  47 ++
 include/migration/vmstate.h      |   2 +-
 include/qemu/sockets.h           |   1 +
 include/qemu/typedefs.h          |   8 +-
 include/sysemu/sysemu.h          |  41 +-
 migration-rdma.c                 |   4 +-
 migration.c                      | 680 ++++++++++++++++++++++++++--
 postcopy-ram.c                   | 924 +++++++++++++++++++++++++++++++++++++++
 qapi-schema.json                 |  14 +-
 qemu-file.c                      | 552 ++++++++++++++++++++++-
 qmp-commands.hx                  |  19 +
 savevm.c                         | 848 ++++++++++++++++++++++++++++++++---
 tests/Makefile                   |   2 +-
 tests/test-vmstate.c             |  73 ++--
 util/qemu-sockets.c              |  28 ++
 25 files changed, 4069 insertions(+), 176 deletions(-)
 create mode 100644 include/migration/postcopy-ram.h
 create mode 100644 postcopy-ram.c

-- 
1.9.3

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2014-09-12 11:23 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28 15:03 [Qemu-devel] [PATCH v3 00/47] Postcopy implementation Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 01/47] QEMUSizedBuffer/QEMUFile Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 02/47] Tests: QEMUSizedBuffer/QEMUBuffer Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 03/47] Start documenting how postcopy works Dr. David Alan Gilbert (git)
2014-09-09  3:34   ` Hongyang Yang
2014-09-09  3:46     ` Hongyang Yang
2014-09-09  3:39   ` Hongyang Yang
2014-09-12 11:23     ` Dr. David Alan Gilbert
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 04/47] qemu_ram_foreach_block: pass up error value, and down the ramblock name Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 05/47] improve DPRINTF macros, add to savevm Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 06/47] Add qemu_get_counted_string to read a string prefixed by a count byte Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 07/47] Create MigrationIncomingState Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 08/47] socket shutdown Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 09/47] Return path: Open a return path on QEMUFile for sockets Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 10/47] Return path: socket_writev_buffer: Block even on non-blocking fd's Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 11/47] Migration commands Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 12/47] Return path: Control commands Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 13/47] Return path: Send responses from destination to source Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 14/47] Return path: Source handling of return path Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 15/47] qemu_loadvm errors and debug Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 16/47] ram_debug_dump_bitmap: Dump a migration bitmap as text Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 17/47] Rework loadvm path for subloops Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 18/47] Add migration-capability boolean for postcopy-ram Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 19/47] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 20/47] QEMU_VM_CMD_PACKAGED: Send a packaged chunk of migration stream Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 21/47] migrate_init: Call from savevm Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 22/47] Allow savevm handlers to state whether they could go into postcopy Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 23/47] postcopy: OS support test Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 24/47] migrate_start_postcopy: Command to trigger transition to postcopy Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 25/47] MIG_STATE_POSTCOPY_ACTIVE: Add new migration state Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 26/47] qemu_savevm_state_complete: Postcopy changes Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 27/47] Postcopy: Maintain sentmap during postcopy pre phase Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 28/47] Postcopy page-map-incoming (PMI) structure Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 29/47] postcopy: Add incoming_init/cleanup functions Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 30/47] postcopy: Incoming initialisation Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 31/47] postcopy: ram_enable_notify to switch on userfault Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 32/47] Postcopy: postcopy_start Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 33/47] Postcopy: Rework migration thread for postcopy mode Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 34/47] mig fd_connect: open return path Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [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 15:03 ` [Qemu-devel] [PATCH v3 36/47] Page request: Add MIG_RPCOMM_REQPAGES reverse command Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 37/47] Page request: Process incoming page request Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 38/47] Page request: Consume pages off the post-copy queue Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 39/47] Add assertion to check migration_dirty_pages Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 40/47] postcopy_ram.c: place_page and helpers Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 41/47] Postcopy: Use helpers to map pages during migration Dr. David Alan Gilbert (git)
2014-08-28 15:03 ` [Qemu-devel] [PATCH v3 42/47] qemu_ram_block_from_host Dr. David Alan Gilbert (git)
2014-08-28 15:04 ` [Qemu-devel] [PATCH v3 43/47] Don't sync dirty bitmaps in postcopy Dr. David Alan Gilbert (git)
2014-08-28 15:04 ` [Qemu-devel] [PATCH v3 44/47] Postcopy; Handle userfault requests Dr. David Alan Gilbert (git)
2014-08-28 15:04 ` [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 15:04 ` [Qemu-devel] [PATCH v3 46/47] postcopy: Wire up loadvm_postcopy_ram_handle_{run, end} commands Dr. David Alan Gilbert (git)
2014-08-28 15:04 ` [Qemu-devel] [PATCH v3 47/47] End of migration for postcopy Dr. David Alan Gilbert (git)

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).