All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v7 00/42] Postcopy implementation
@ 2015-06-16 10:26 Dr. David Alan Gilbert (git)
  2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 01/42] Start documenting how postcopy works Dr. David Alan Gilbert (git)
                   ` (42 more replies)
  0 siblings, 43 replies; 209+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2015-06-16 10:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: aarcange, yamahata, quintela, liang.z.li, luis, amit.shah,
	pbonzini, david

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

  This is the 7th cut of my version of postcopy; it is designed for use with
the Linux kernel additions posted by Andrea Arcangeli here:

git clone --reference linux -b userfault21
git://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git

Note this API is slightly different from the last version; but the code is now
in the linux-mm tree, the API is getting stable and the kernel code is just
getting fixes now.

This qemu series can be found at:

https://github.com/orbitfp7/qemu.git
on the wp3-postcopy-v7 tag.

It addresses most of the previous review comments, but there are
still one or two I'm working.

As with v6, the userfaultfd.h isn't included in the tree, so you'll
need a userfaultfd.h header (and syscall define) from Andrea's kernel.

This work has been partially funded by the EU Orbit project:
  see http://www.orbitproject.eu/about/

v7
  updated to Andrea's userfault 21 interface
  Don't restart the source after an error if we entered postcopy (thanks to Li Liang for reporting)
  Killed off dead local_tmp_page (thanks to Christoph Seifert for spotting that)
  Made sure the incoming page mutex is only initialised once
  Moved request alignment from destination to source; destination now just verifies the request is aligned
  Got rid of the 'dup' on the return-fd
     Just use the same fd and make the forward path own the fd
  Reworked the consumption of request pages off the queue to handle hosts with larger
    pages more cleanly
  Disallowed enabling postcopy+compression
     This is probably fixable, but it needs reworking of the decompression threads
     to place the pages atomically
  Disallow postcopy+RDMA
     This is probably trickier to fix; RDMA drops the received data straight into memory using
     DMA; we would need to find a way to stop that. I can see a way to make it so that
     the precopy phase still uses RDMA and then stops using it later, but that would
     make it harder when a real fix came along.
  Minor fixups from review
  6 of the smaller patches from v6 are now already in head

TODO
  Testing on machines with hps!=tps
  Tidy up the hps!=tps code on the receive side

Dr. David Alan Gilbert (42):
  Start documenting how postcopy works.
  Provide runtime Target page information
  Init page sizes in qtest
  qemu_ram_block_from_host
  Add qemu_get_buffer_less_copy to avoid copies some of the time
  Add wrapper for setting blocking status on a QEMUFile
  ram_debug_dump_bitmap: Dump a migration bitmap as text
  migrate_init: Call from savevm
  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
  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
  Postcopy end in migration_thread
  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
  Host page!=target page: Cleanup bitmaps
  Postcopy; Handle userfault requests
  Start up a postcopy/listener thread ready for incoming page data
  postcopy: Wire up loadvm_postcopy_handle_ commands
  End of migration for postcopy
  Disable mlock around incoming postcopy
  Inhibit ballooning during postcopy

 balloon.c                        |  11 +
 docs/migration.txt               | 167 +++++++
 exec.c                           |  64 ++-
 hmp-commands.hx                  |  15 +
 hmp.c                            |   7 +
 hmp.h                            |   1 +
 hw/ppc/spapr.c                   |   2 +-
 hw/virtio/virtio-balloon.c       |   4 +-
 include/exec/cpu-all.h           |   2 -
 include/exec/cpu-common.h        |   3 +
 include/migration/migration.h    | 112 ++++-
 include/migration/postcopy-ram.h |  88 ++++
 include/migration/qemu-file.h    |  10 +
 include/migration/vmstate.h      |   8 +-
 include/qemu/typedefs.h          |   3 +
 include/sysemu/balloon.h         |   2 +
 include/sysemu/sysemu.h          |  44 +-
 migration/Makefile.objs          |   2 +-
 migration/block.c                |   9 +-
 migration/migration.c            | 736 ++++++++++++++++++++++++++++--
 migration/postcopy-ram.c         | 706 +++++++++++++++++++++++++++++
 migration/qemu-file-unix.c       | 110 ++++-
 migration/qemu-file.c            |  74 ++++
 migration/ram.c                  | 933 ++++++++++++++++++++++++++++++++++++---
 migration/savevm.c               | 776 +++++++++++++++++++++++++++++---
 qapi-schema.json                 |  18 +-
 qmp-commands.hx                  |  19 +
 qtest.c                          |   1 +
 trace-events                     |  76 +++-
 29 files changed, 3788 insertions(+), 215 deletions(-)
 create mode 100644 include/migration/postcopy-ram.h
 create mode 100644 migration/postcopy-ram.c

-- 
2.4.3

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

end of thread, other threads:[~2015-10-20 10:29 UTC | newest]

Thread overview: 209+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 10:26 [Qemu-devel] [PATCH v7 00/42] Postcopy implementation Dr. David Alan Gilbert (git)
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 01/42] Start documenting how postcopy works Dr. David Alan Gilbert (git)
2015-06-17 11:42   ` Juan Quintela
2015-06-17 12:30     ` Dr. David Alan Gilbert
2015-06-18  7:50   ` Li, Liang Z
2015-06-18  8:10     ` Dr. David Alan Gilbert
2015-06-18  8:28     ` Paolo Bonzini
2015-06-19 17:52       ` Dr. David Alan Gilbert
2015-06-26  6:46   ` Yang Hongyang
2015-06-26  7:53     ` zhanghailiang
2015-06-26  8:00       ` Yang Hongyang
2015-06-26  8:10         ` Dr. David Alan Gilbert
2015-06-26  8:19           ` Yang Hongyang
2015-08-04  5:20   ` Amit Shah
2015-08-05 12:21     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 02/42] Provide runtime Target page information Dr. David Alan Gilbert (git)
2015-06-17 11:43   ` Juan Quintela
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 03/42] Init page sizes in qtest Dr. David Alan Gilbert (git)
2015-06-17 11:49   ` Juan Quintela
2015-07-06  6:14   ` Amit Shah
2015-08-04  5:23   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 04/42] qemu_ram_block_from_host Dr. David Alan Gilbert (git)
2015-06-17 11:54   ` Juan Quintela
2015-07-10  8:36   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 05/42] Add qemu_get_buffer_less_copy to avoid copies some of the time Dr. David Alan Gilbert (git)
2015-06-17 11:57   ` Juan Quintela
2015-06-17 12:33     ` Dr. David Alan Gilbert
2015-07-13  9:08   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 06/42] Add wrapper for setting blocking status on a QEMUFile Dr. David Alan Gilbert (git)
2015-06-17 11:59   ` Juan Quintela
2015-06-17 12:34     ` Dr. David Alan Gilbert
2015-06-17 12:57       ` Juan Quintela
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 07/42] ram_debug_dump_bitmap: Dump a migration bitmap as text Dr. David Alan Gilbert (git)
2015-06-17 12:17   ` Juan Quintela
2015-06-19 17:04     ` Dr. David Alan Gilbert
2015-07-13 10:15       ` Juan Quintela
2015-07-13  9:12   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 08/42] migrate_init: Call from savevm Dr. David Alan Gilbert (git)
2015-06-17 12:18   ` Juan Quintela
2015-07-13  9:13   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 09/42] Rename save_live_complete to save_live_complete_precopy Dr. David Alan Gilbert (git)
2015-06-17 12:20   ` Juan Quintela
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 10/42] Return path: Open a return path on QEMUFile for sockets Dr. David Alan Gilbert (git)
2015-06-17 12:23   ` Juan Quintela
2015-06-17 17:07     ` Dr. David Alan Gilbert
2015-07-13 10:12   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 11/42] Return path: socket_writev_buffer: Block even on non-blocking fd's Dr. David Alan Gilbert (git)
2015-06-17 12:28   ` Juan Quintela
2015-06-19 17:18     ` Dr. David Alan Gilbert
2015-07-13 12:37   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 12/42] Migration commands Dr. David Alan Gilbert (git)
2015-06-17 12:31   ` Juan Quintela
2015-06-19 17:38     ` Dr. David Alan Gilbert
2015-07-13 12:45   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 13/42] Return path: Control commands Dr. David Alan Gilbert (git)
2015-06-17 12:49   ` Juan Quintela
2015-06-23 18:57     ` Dr. David Alan Gilbert
2015-07-13 12:55   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 14/42] Return path: Send responses from destination to source Dr. David Alan Gilbert (git)
2015-06-17 16:30   ` Juan Quintela
2015-06-19 18:42     ` Dr. David Alan Gilbert
2015-07-01  9:29       ` Juan Quintela
2015-08-06 12:18         ` Dr. David Alan Gilbert
2015-07-15  7:31   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 15/42] Return path: Source handling of return path Dr. David Alan Gilbert (git)
2015-07-13 10:29   ` Juan Quintela
2015-08-18 10:23     ` Dr. David Alan Gilbert
2015-07-15  7:50   ` Amit Shah
2015-07-16 11:32     ` Dr. David Alan Gilbert
2015-08-05  8:06   ` zhanghailiang
2015-08-18 10:45     ` Dr. David Alan Gilbert
2015-08-18 11:29       ` zhanghailiang
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 16/42] Rework loadvm path for subloops Dr. David Alan Gilbert (git)
2015-07-13 10:33   ` Juan Quintela
2015-07-15  9:34   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 17/42] Add migration-capability boolean for postcopy-ram Dr. David Alan Gilbert (git)
2015-06-16 15:43   ` Eric Blake
2015-06-16 15:58     ` Dr. David Alan Gilbert
2015-07-15  9:39       ` Amit Shah
2015-07-13 10:35   ` Juan Quintela
2015-07-15  9:40   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 18/42] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages Dr. David Alan Gilbert (git)
2015-07-13 11:02   ` Juan Quintela
2015-07-20 10:13     ` Amit Shah
2015-08-26 14:48     ` Dr. David Alan Gilbert
2015-07-20 10:06   ` Amit Shah
2015-07-27  9:55     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 19/42] MIG_CMD_PACKAGED: Send a packaged chunk of migration stream Dr. David Alan Gilbert (git)
2015-07-13 11:07   ` Juan Quintela
2015-07-21  6:11   ` Amit Shah
2015-07-27 17:28     ` Dr. David Alan Gilbert
2015-08-04  5:27   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 20/42] Modify save_live_pending for postcopy Dr. David Alan Gilbert (git)
2015-07-13 11:12   ` Juan Quintela
2015-07-31 16:13     ` Dr. David Alan Gilbert
2015-07-21  6:17   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 21/42] postcopy: OS support test Dr. David Alan Gilbert (git)
2015-07-13 11:20   ` Juan Quintela
2015-07-13 16:31     ` Dr. David Alan Gilbert
2015-07-21  7:29   ` Amit Shah
2015-07-27 17:38     ` Dr. David Alan Gilbert
2015-08-04  5:28   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 22/42] migrate_start_postcopy: Command to trigger transition to postcopy Dr. David Alan Gilbert (git)
2015-07-13 11:23   ` Juan Quintela
2015-07-13 17:13     ` Dr. David Alan Gilbert
2015-07-13 18:07       ` Juan Quintela
2015-07-21  7:40         ` Amit Shah
2015-09-24  9:59           ` Dr. David Alan Gilbert
2015-09-24 14:20         ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 23/42] MIGRATION_STATUS_POSTCOPY_ACTIVE: Add new migration state Dr. David Alan Gilbert (git)
2015-07-13 11:27   ` Juan Quintela
2015-07-13 15:53     ` Dr. David Alan Gilbert
2015-07-13 16:26       ` Juan Quintela
2015-07-13 16:48         ` Dr. David Alan Gilbert
2015-07-13 18:05           ` Juan Quintela
2015-07-21 10:33   ` Amit Shah
2015-09-23 17:04     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 24/42] Add qemu_savevm_state_complete_postcopy Dr. David Alan Gilbert (git)
2015-07-13 11:35   ` Juan Quintela
2015-07-13 15:33     ` Dr. David Alan Gilbert
2015-07-21 10:42   ` Amit Shah
2015-07-27 17:58     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 25/42] Postcopy: Maintain sentmap and calculate discard Dr. David Alan Gilbert (git)
2015-07-13 11:47   ` Juan Quintela
2015-09-15 17:01     ` Dr. David Alan Gilbert
2015-07-21 11:36   ` Amit Shah
2015-07-31 16:51     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 26/42] postcopy: Incoming initialisation Dr. David Alan Gilbert (git)
2015-07-13 12:04   ` Juan Quintela
2015-09-23 19:06     ` Dr. David Alan Gilbert
2015-07-22  6:19   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 27/42] postcopy: ram_enable_notify to switch on userfault Dr. David Alan Gilbert (git)
2015-07-13 12:10   ` Juan Quintela
2015-07-13 17:36     ` Dr. David Alan Gilbert
2015-07-23  5:22   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 28/42] Postcopy: Postcopy startup in migration thread Dr. David Alan Gilbert (git)
2015-07-13 12:56   ` Juan Quintela
2015-07-13 17:56     ` Dr. David Alan Gilbert
2015-07-13 18:09       ` Juan Quintela
2015-09-23 17:56         ` Dr. David Alan Gilbert
2015-07-23  5:53       ` Amit Shah
2015-07-23  5:55   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 29/42] Postcopy end in migration_thread Dr. David Alan Gilbert (git)
2015-07-13 13:15   ` Juan Quintela
2015-07-23  6:41     ` Amit Shah
2015-08-04 11:31     ` Dr. David Alan Gilbert
2015-07-23  6:41   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 30/42] Page request: Add MIG_RP_MSG_REQ_PAGES reverse command Dr. David Alan Gilbert (git)
2015-07-13 13:24   ` Juan Quintela
2015-08-06 14:15     ` Dr. David Alan Gilbert
2015-07-23  6:50   ` Amit Shah
2015-08-06 14:21     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 31/42] Page request: Process incoming page request Dr. David Alan Gilbert (git)
2015-07-14  9:18   ` Juan Quintela
2015-08-06 10:45     ` Dr. David Alan Gilbert
2015-10-20 10:29       ` Juan Quintela
2015-07-23 12:23   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 32/42] Page request: Consume pages off the post-copy queue Dr. David Alan Gilbert (git)
2015-07-14  9:40   ` Juan Quintela
2015-09-16 18:36     ` Dr. David Alan Gilbert
2015-07-27  6:05   ` Amit Shah
2015-09-16 18:48     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 33/42] postcopy_ram.c: place_page and helpers Dr. David Alan Gilbert (git)
2015-07-14 10:05   ` Juan Quintela
2015-07-27  6:11     ` Amit Shah
2015-09-23 16:45     ` Dr. David Alan Gilbert
2015-07-27  6:11   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 34/42] Postcopy: Use helpers to map pages during migration Dr. David Alan Gilbert (git)
2015-07-14 12:34   ` Juan Quintela
2015-07-17 17:31     ` Dr. David Alan Gilbert
2015-07-27  7:39   ` Amit Shah
2015-08-06 11:22     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 35/42] Don't sync dirty bitmaps in postcopy Dr. David Alan Gilbert (git)
2015-07-14 12:36   ` Juan Quintela
2015-07-14 13:13     ` Dr. David Alan Gilbert
2015-07-27  7:43   ` Amit Shah
2015-07-31  9:50     ` Dr. David Alan Gilbert
2015-08-04  5:46       ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 36/42] Host page!=target page: Cleanup bitmaps Dr. David Alan Gilbert (git)
2015-07-14 15:01   ` Juan Quintela
2015-07-31 15:53     ` Dr. David Alan Gilbert
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 37/42] Postcopy; Handle userfault requests Dr. David Alan Gilbert (git)
2015-07-14 15:10   ` Juan Quintela
2015-07-14 15:15     ` Dr. David Alan Gilbert
2015-07-14 15:25       ` Juan Quintela
2015-07-27 14:29   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 38/42] Start up a postcopy/listener thread ready for incoming page data Dr. David Alan Gilbert (git)
2015-07-14 15:12   ` Juan Quintela
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 39/42] postcopy: Wire up loadvm_postcopy_handle_ commands Dr. David Alan Gilbert (git)
2015-07-14 15:14   ` Juan Quintela
2015-07-28  5:53   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 40/42] End of migration for postcopy Dr. David Alan Gilbert (git)
2015-07-14 15:15   ` Juan Quintela
2015-07-28  5:55   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 41/42] Disable mlock around incoming postcopy Dr. David Alan Gilbert (git)
2015-07-14 15:22   ` Juan Quintela
2015-07-28  6:02     ` Amit Shah
2015-07-28 11:32       ` Juan Quintela
2015-08-06 14:55         ` Dr. David Alan Gilbert
2015-08-07  3:05           ` zhanghailiang
2015-09-24 10:36     ` Dr. David Alan Gilbert
2015-07-28  6:02   ` Amit Shah
2015-06-16 10:26 ` [Qemu-devel] [PATCH v7 42/42] Inhibit ballooning during postcopy Dr. David Alan Gilbert (git)
2015-07-14 15:24   ` Juan Quintela
2015-07-28  6:15   ` Amit Shah
2015-07-28  9:08     ` Dr. David Alan Gilbert
2015-07-28 10:01       ` Amit Shah
2015-07-28 11:16         ` Dr. David Alan Gilbert
2015-07-28  6:21 ` [Qemu-devel] [PATCH v7 00/42] Postcopy implementation Amit Shah

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.