All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lei Li <lilei@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: aarcange@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org,
	mrhines@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com,
	anthony@codemonkey.ws, lagarcia@br.ibm.com,
	rcj@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 0/8 RFC] migration: Introduce side channel for RAM
Date: Thu, 03 Oct 2013 18:28:48 +0800	[thread overview]
Message-ID: <524D46E0.7010002@linux.vnet.ibm.com> (raw)
In-Reply-To: <524D2985.8050301@redhat.com>

On 10/03/2013 04:23 PM, Paolo Bonzini wrote:
> Il 03/10/2013 06:03, Lei Li ha scritto:
>> Hi Paolo,
>>
>> When debugging the code, I realized that this problem might still
>> exist. In the incoming part, it will qemu_fopen_pipe() in
>> unix_accept_incoming_migration first to enable the load_hook
>> callback, the check action of this RAM_SAVE_FLAG_HOOK flags would
>> lead to 8 bytes taken. Turns out, it will break normal unix
>> migration (without unix-page-flipping), because no matter normal unix
>> migration or unix-page-flipping migration, the incoming side has to
>> check this 8-byes flags first to decide whether the load_hook is
>> called, and normal unix migration did not send this 8-byte flags.
> Why is the load_hook callback being called at all without page flipping?
>   Without page flipping, the before_iterate and save_page hook will
> return immediately (or depending on your code they may never be called),
> so the RAM_SAVE_FLAG_HOOK will never be written to the Unix socket.

The load_hook callback is only be called if the RAM_SAVE_FLAG_HOOK is received.
To check this flags, it means there would be a check action first in
unix_accept_incoming_migration(), like:

f = qemu_fopen_pipe(c, "rb");
flags = qemu_get_be64(f);
if (flags == RAM_SAVE_FLAG_HOOK) {
     load_hook();
     ...
}

Otherwise, the incoming side has no idea whether the special 8-bytes record
(RAM_SAVE_FLAG_HOOK) is sent.

In unix-page-flipping migration, it is OK. Without page flipping, since the
RAM_SAVE_FLAG_HOOK is not be written to the Unix socket, but the incoming
side will still check it, that will lead to the unexpected 8-bytes taken.

If the logic and the way to deal with it above is correct according to your
suggestion, how about:

1) Use another Unix socket to deal with this flags and pipe fd passing.
or 2) Use a new prefix URI for the incoming.

>
>> I wonder if I didn't understand your suggestion correctly?
> Perhaps you want to discuss this tomorrow morning on #qemu?

I joined the #qemu channel just now, seems you were not there.
I guess it's your lunch time right now. :)

>
> Paolo
>


-- 
Lei

  reply	other threads:[~2013-10-03 10:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25 14:32 [Qemu-devel] [PATCH 0/8 RFC] migration: Introduce side channel for RAM Lei Li
2013-09-25 14:32 ` [Qemu-devel] [PATCH 1/8] migration-local: add pipe protocol for QEMUFileOps Lei Li
2013-09-25 14:32 ` [Qemu-devel] [PATCH 2/8] migration-loca: add qemu_fopen_pipe() Lei Li
2013-09-25 14:32 ` [Qemu-devel] [PATCH 3/8] migration-local: add send_pipefd() Lei Li
2013-09-25 14:32 ` [Qemu-devel] [PATCH 4/8] migration-local: add recv_pipefd() Lei Li
2013-09-25 14:32 ` [Qemu-devel] [PATCH 5/8] QAPI: introduce magration capability unix_page_flipping Lei Li
2013-09-25 14:32 ` [Qemu-devel] [PATCH 6/8] migration: add migrate_unix_page_flipping() Lei Li
2013-09-25 14:32 ` [Qemu-devel] [PATCH 7/8] migration-unix: side channel support on unix outgoing Lei Li
2013-09-25 14:32 ` [Qemu-devel] [PATCH 8/8] migration-unix: side channel support on unix incoming Lei Li
2013-09-25 15:02 ` [Qemu-devel] [PATCH 0/8 RFC] migration: Introduce side channel for RAM Paolo Bonzini
2013-09-26 12:44   ` Lei Li
2013-09-26 12:54     ` Paolo Bonzini
2013-10-03  4:03     ` Lei Li
2013-10-03  8:23       ` Paolo Bonzini
2013-10-03 10:28         ` Lei Li [this message]
2013-10-03 10:34           ` Paolo Bonzini
2013-10-03 13:29             ` Lei Li
2013-10-03 13:34               ` Paolo Bonzini
2013-10-03 13:37                 ` Lei Li

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=524D46E0.7010002@linux.vnet.ibm.com \
    --to=lilei@linux.vnet.ibm.com \
    --cc=aarcange@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=lagarcia@br.ibm.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mrhines@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rcj@linux.vnet.ibm.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 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.