From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Peter Lieven <pl@kamp.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] broken incoming migration
Date: Thu, 30 May 2013 19:31:53 +1000 [thread overview]
Message-ID: <51A71C89.4070902@ozlabs.ru> (raw)
In-Reply-To: <51A71705.6060009@kamp.de>
On 05/30/2013 07:08 PM, Peter Lieven wrote:
> Am 30.05.2013 10:18, schrieb Alexey Kardashevskiy:
>> On 05/30/2013 05:49 PM, Paolo Bonzini wrote:
>>> Il 30/05/2013 09:44, Alexey Kardashevskiy ha scritto:
>>>> Hi!
>>>>
>>>> I found the migration broken on pseries platform, specifically, this patch
>>>> broke it:
>>>>
>>>> f1c72795af573b24a7da5eb52375c9aba8a37972
>>>> migration: do not sent zero pages in bulk stage
>>>>
>>>> The idea is not to send zero pages to the destination guest which is
>>>> expected to have 100% empty RAM.
>>>>
>>>> However on pseries plaftorm the guest always has some stuff in the RAM as a
>>>> part of initialization (device tree, system firmware and rtas (?)) so it is
>>>> not completely empty. As the source guest cannot detect this, it skips some
>>>> pages during migration and we get a broken destination guest. Bug.
>>>>
>>>> While the idea is ok in general, I do not see any easy way to fix it as
>>>> neither QEMUMachine::init nor QEMUMachine::reset callbacks has information
>>>> about whether we are about to receive a migration or not (-incoming
>>>> parameter) and we cannot move device-tree and system firmware
>>>> initialization anywhere else.
>>>>
>>>> ram_bulk_stage is static and cannot be disabled from the platform
>>>> initialization code.
>>>>
>>>> So what would the community suggest?
>>> Revert the patch. :)
>> I'll wait for 24 hours (forgot to cc: the author) and then post a revert
>> patch :)
>>
>>
>>
> does this problem only occur on pseries emulation?
No idea, really.
> not sending zero pages is not only a performance benefit it also makes
> overcomitted memory usable. the madv_dontneed seems to kick in asynchronously
> and memory is not available immediately.
Ok, I do not mind :)
> what I do not understand if the a memory region is not empty at destination
> due to device tree, firmware etc. it shouldn't be empty at the source as well so
> in theory this should not be a problem.
This is how it works - first QEMU allocates RAM and put devicetree+firmware
somewhere. Then QEMU starts the guest so the firmware starts, loads the
kernel and then the kernel zeroes the whole (most of?) RAM including the
area where the firmware used to be.
Now we migrate. If the source guest is in the kernel already, then it does
not know about the memory area previously occupied by the firmware, it is
just an empty page. If the source guest is still in the firmware, then
those pages are not empty and they are perfectly migrated.
--
Alexey
next prev parent reply other threads:[~2013-05-30 9:32 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 7:44 [Qemu-devel] broken incoming migration Alexey Kardashevskiy
2013-05-30 7:49 ` Alexey Kardashevskiy
2013-05-30 7:49 ` Paolo Bonzini
2013-05-30 8:18 ` Alexey Kardashevskiy
2013-05-30 9:08 ` Peter Lieven
2013-05-30 9:31 ` Alexey Kardashevskiy [this message]
2013-05-30 13:00 ` Paolo Bonzini
2013-05-30 13:38 ` Alexey Kardashevskiy
2013-05-30 14:08 ` Paolo Bonzini
2013-05-30 14:38 ` Peter Lieven
2013-05-30 14:41 ` Paolo Bonzini
2013-06-04 13:52 ` Peter Lieven
2013-06-04 14:14 ` Paolo Bonzini
2013-06-04 14:38 ` Peter Lieven
2013-06-04 14:40 ` Paolo Bonzini
2013-06-04 14:48 ` Peter Lieven
2013-06-04 15:17 ` Paolo Bonzini
2013-06-04 19:15 ` Peter Lieven
2013-06-05 3:37 ` Alexey Kardashevskiy
2013-06-05 6:09 ` Peter Lieven
2013-06-09 4:12 ` liu ping fan
2013-06-09 7:22 ` Peter Lieven
2013-06-04 15:10 ` Peter Lieven
2013-06-08 8:27 ` Wenchao Xia
2013-06-08 8:30 ` Alexey Kardashevskiy
2013-06-09 2:16 ` Wenchao Xia
2013-06-09 2:34 ` Alexey Kardashevskiy
2013-06-09 2:52 ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2013-06-09 3:01 ` Alexey Kardashevskiy
2013-06-09 3:01 ` [Qemu-devel] " Wenchao Xia
2013-06-09 3:09 ` Alexey Kardashevskiy
2013-06-09 3:31 ` Wenchao Xia
2013-06-09 7:27 ` Peter Lieven
2013-06-10 6:39 ` Alexey Kardashevskiy
2013-06-10 6:50 ` Peter Lieven
2013-06-10 6:55 ` Alexey Kardashevskiy
2013-06-10 8:44 ` Peter Lieven
2013-06-10 9:10 ` Alexey Kardashevskiy
2013-06-10 9:33 ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
2013-06-10 9:42 ` Peter Lieven
2013-06-09 2:53 ` Benjamin Herrenschmidt
2013-06-12 14:00 ` Paolo Bonzini
2013-06-12 14:11 ` Benjamin Herrenschmidt
2013-06-12 20:10 ` Paolo Bonzini
2013-06-13 2:41 ` Wenchao Xia
2013-06-03 10:04 ` [Qemu-devel] " Alexey Kardashevskiy
2013-06-04 10:56 ` Peter Lieven
2013-06-08 8:24 ` Wenchao Xia
2013-05-30 10:18 ` Peter Maydell
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=51A71C89.4070902@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=pbonzini@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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).