qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Christian Pinto <c.pinto@virtualopensystems.com>
Cc: zhang.zhanghailiang@huawei.com, b.reynal@virtualopensystems.com,
	aarcange@redhat.com, quintela@redhat.com,
	peter.huangpeng@huawei.com, hanweidong@huawei.com,
	qemu-devel@nongnu.org, tech@virtualopensystems.com
Subject: Re: [Qemu-devel] [RFC PATCH 0/4] ARM/ARM64 fixes for live memory snapshot based on userfaultfd
Date: Thu, 9 Mar 2017 17:46:43 +0000	[thread overview]
Message-ID: <20170309174642.GM2480@work-vm> (raw)
In-Reply-To: <20170309113437.9667-1-c.pinto@virtualopensystems.com>

* Christian Pinto (c.pinto@virtualopensystems.com) wrote:
> This patch series introduces a set of fixes to the previous work proposed by
> Hailiang Zhang to enable in QEMU live memory snapshot based
> on userfaultfd. See discussion here:
> http://www.mail-archive.com/qemu-devel@nongnu.org/msg393118.html

Thanks for posting this,

> These patches apply on top of: 
> https://github.com/coloft/qemu/tree/snapshot-v2
> that is the latest version of Hailiang's work, and rely on the latest work on
> userfaultfd available on Andrea Arcangeli's Linux kernel tree:
> https://git.kernel.org/cgit/linux/kernel/git/andrea/aa.git/log/?h=userfault
> 
> The original work was mainly tested on x86 tcg machines and was not working
> ARM/ARM64 tcg.
> The fixes presented in this series enable the live memory snapshot
> to work for ARM64 tcg guests running on top of an ARM64 host.
> 
> The main problems encountered were:
>     - QEMU uses for ARM a memory page size of 1KB. Even though this size is not
>       supported by the Linux kernel, is is kept for backward compatibility
>       with older ARM CPU MMUs. Initial work was write-unprotecting pages with
>       a granularity not always aligned with host page size, causing userfaultfd
>       to fail.

Yes, Power similarly has a 4kb size for the target page size even though
the host kernel is normally a large page size.

>     - The VM execution was resumed right before the status of the migration
>       was switched from MIGRATION_STATUS_SETUP to MIGRATION_STATUS_ACTIVE.
>       This was causing again the VM to trigger a "Bus error", due to wrong
>       status of some memory pages.
>     - When unprotecting a memory page the flag
>       UFFDIO_WRITEPROTECT_MODE_DONTWAKE was used. This way, after a page is
>       copied into snapshot file, the virtual machine execution is not resumed.
> 
> 
> To test the patches on an ARM64 host, boot an ARM64 tcg machine:
> 
> qemu-system-aarch64 -machine virt,accel=tcg -cpu cortex-a57\
>         -m 256 -kernel Image \
>         -initrd rootfs.cpio.gz \
>         -append "earlyprintk rw console=ttyAMA0" \
>         -net nic -net user \
>         -nographic -serial pty -monitor stdio
> 
> start migration from QEMU monitor:
> 
>     (qemu) migrate file:/root/test_snapshot
> 
> 
> resume VM form snapshot:
> 
> qemu-system-aarch64 -machine virt,accel=tcg -cpu cortex-a57\
>         -m 256 -kernel Image \
>         -initrd rootfs.cpio.gz \
>         -append "earlyprintk rw console=ttyAMA0" \
>         -net nic -net user \
>         -nographic -serial stdio -monitor pty \
>         -incoming file:/root/test_snapshot

Nice, what's your use case and how are you dealing with storage?

Dave

> Christian Pinto (4):
>   migration/postcopy-ram: check pagefault flags in userfaultfd thread
>   migration/ram: Fix for ARM/ARM64 page size
>   migration: snapshot thread
>   migration/postcopy-ram: ram_set_pages_wp fix
> 
>  migration/migration.c    |  9 +++++----
>  migration/postcopy-ram.c | 25 ++++++++-----------------
>  migration/ram.c          | 18 ++++++++++++++----
>  3 files changed, 27 insertions(+), 25 deletions(-)
> 
> -- 
> 2.11.0
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  parent reply	other threads:[~2017-03-09 17:46 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 12:19 [Qemu-devel] [RFC 00/13] Live memory snapshot based on userfaultfd zhanghailiang
2016-01-07 12:19 ` [Qemu-devel] [RFC 01/13] postcopy/migration: Split fault related state into struct UserfaultState zhanghailiang
2016-01-07 12:19 ` [Qemu-devel] [RFC 02/13] migration: Allow the migrate command to work on file: urls zhanghailiang
2016-07-13 16:12   ` Dr. David Alan Gilbert
2016-07-14  5:27     ` Hailiang Zhang
2016-01-07 12:19 ` [Qemu-devel] [RFC 03/13] migration: Allow -incoming " zhanghailiang
2016-01-11 20:02   ` Dr. David Alan Gilbert
2016-01-12 13:04     ` Hailiang Zhang
2016-01-07 12:19 ` [Qemu-devel] [RFC 04/13] migration: Create a snapshot thread to realize saving memory snapshot zhanghailiang
2016-01-07 12:20 ` [Qemu-devel] [RFC 05/13] migration: implement initialization work for snapshot zhanghailiang
2016-01-07 12:20 ` [Qemu-devel] [RFC 06/13] QEMUSizedBuffer: Introduce two help functions for qsb zhanghailiang
2016-01-07 12:20 ` [Qemu-devel] [RFC 07/13] savevm: Split qemu_savevm_state_complete_precopy() into two helper functions zhanghailiang
2016-01-07 12:20 ` [Qemu-devel] [RFC 08/13] snapshot: Save VM's device state into snapshot file zhanghailiang
2016-01-07 12:20 ` [Qemu-devel] [RFC 09/13] migration/postcopy-ram: fix some helper functions to support userfaultfd write-protect zhanghailiang
2016-01-07 12:20 ` [Qemu-devel] [RFC 10/13] snapshot: Enable the write-protect notification capability for VM's RAM zhanghailiang
2016-01-07 12:20 ` [Qemu-devel] [RFC 11/13] snapshot/migration: Save VM's RAM into snapshot file zhanghailiang
2016-01-07 12:20 ` [Qemu-devel] [RFC 12/13] migration/ram: Fix some helper functions' parameter to use PageSearchStatus zhanghailiang
2016-01-11 17:55   ` Dr. David Alan Gilbert
2016-01-12 12:59     ` Hailiang Zhang
2016-01-07 12:20 ` [Qemu-devel] [RFC 13/13] snapshot: Remove page's write-protect and copy the content during setup stage zhanghailiang
2016-07-13 17:52   ` Dr. David Alan Gilbert
2016-07-14  8:02     ` Hailiang Zhang
2016-07-04 12:22 ` [Qemu-devel] [RFC 00/13] Live memory snapshot based on userfaultfd Baptiste Reynal
2016-07-05  1:49   ` Hailiang Zhang
2016-07-05  9:57     ` Baptiste Reynal
2016-07-05 10:27       ` Hailiang Zhang
2016-08-18 15:56         ` Andrea Arcangeli
2016-08-20  6:31           ` Hailiang Zhang
2017-02-27 15:37             ` Christian Pinto
2017-02-28  1:48               ` Hailiang Zhang
2017-02-28  8:30                 ` Christian Pinto
2017-02-28 16:14                 ` Andrea Arcangeli
2017-03-01  1:08                   ` Hailiang Zhang
2017-03-09 11:34             ` [Qemu-devel] [RFC PATCH 0/4] ARM/ARM64 fixes for live " Christian Pinto
2017-03-09 11:34               ` [Qemu-devel] [RFC PATCH 1/4] migration/postcopy-ram: check pagefault flags in userfaultfd thread Christian Pinto
2017-03-09 11:34               ` [Qemu-devel] [RFC PATCH 2/4] migration/ram: Fix for ARM/ARM64 page size Christian Pinto
2017-03-09 11:34               ` [Qemu-devel] [RFC PATCH 3/4] migration: snapshot thread Christian Pinto
2017-03-09 11:34               ` [Qemu-devel] [RFC PATCH 4/4] migration/postcopy-ram: ram_set_pages_wp fix Christian Pinto
2017-03-09 17:46               ` Dr. David Alan Gilbert [this message]
2017-03-10  8:15                 ` [Qemu-devel] [RFC PATCH 0/4] ARM/ARM64 fixes for live memory snapshot based on userfaultfd Christian Pinto
2016-09-06  3:39           ` [Qemu-devel] [RFC 00/13] Live " Hailiang Zhang
2016-09-18  2:14             ` Hailiang Zhang
2016-12-08 12:45               ` Hailiang Zhang
2016-07-05 14:59       ` Andrea Arcangeli
2016-07-13 18:02 ` Dr. David Alan Gilbert
2016-07-14 10:24   ` Hailiang Zhang
2016-07-14 11:43     ` Dr. David Alan Gilbert
2016-07-19  6:53       ` Hailiang Zhang

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=20170309174642.GM2480@work-vm \
    --to=dgilbert@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=b.reynal@virtualopensystems.com \
    --cc=c.pinto@virtualopensystems.com \
    --cc=hanweidong@huawei.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=tech@virtualopensystems.com \
    --cc=zhang.zhanghailiang@huawei.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).