All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: dgilbert@redhat.com
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH V3] spapr: Fix stale HTAB during live migration
Date: Tue, 19 Aug 2014 12:51:53 +0200	[thread overview]
Message-ID: <53F32C49.9000106@suse.de> (raw)
In-Reply-To: <1408429031-1716-1-git-send-email-sam.mj@au1.ibm.com>



On 19.08.14 08:17, Samuel Mendoza-Jonas wrote:
> If a guest reboots during a running migration, changes to the
> hash page table are not necessarily updated on the destination.
> Opening a new file descriptor to the HTAB forces the migration
> handler to resend the entire table.
> 
> Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
> ---
> Changes in v3: Pointed out by David, htab_save_iterate could
> 	potentially try to read before htab_fd is open again.
> 	Leave opening the fd to the functions trying to read.
> Changes in v2: Forgot check on kvmppc_get_htab_fd return value
>  hw/ppc/spapr.c         | 25 +++++++++++++++++++++++++
>  include/hw/ppc/spapr.h |  1 +
>  2 files changed, 26 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 3a6d26d..5b41318 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -997,6 +997,10 @@ static void spapr_reset_htab(sPAPREnvironment *spapr)
>          /* Kernel handles htab, we don't need to allocate one */
>          spapr->htab_shift = shift;
>          kvmppc_kern_htab = true;
> +
> +        /* Check if we are overlapping a migration */
> +        if (spapr->htab_fd > 0)
> +            spapr->need_reset = true;

A "need_reset" field in the sPAPR machine with semantics of "we
triggered a reset, so if there's a migration in flight please consider
the full HTAB as invalid and thus reopen the fd to fetch all entries
again" is not exactly obvious to me.

How about something like "htab_save_should_reopen_fd" or an even better
name you might come up with :). Alternatively you could save the last
time stamp of when the HTAB was allocated and compare to that.


Alex

      parent reply	other threads:[~2014-08-19 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19  6:17 [Qemu-devel] [PATCH V3] spapr: Fix stale HTAB during live migration Samuel Mendoza-Jonas
2014-08-19  8:23 ` Dr. David Alan Gilbert
2014-08-19 10:51 ` Alexander Graf [this message]

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=53F32C49.9000106@suse.de \
    --to=agraf@suse.de \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sam.mj@au1.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.