All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Andrew Jones <drjones@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Leonardo Bras Soares Passos <lsoaresp@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH 2/2] dump-guest-memory: Block live migration
Date: Tue, 24 Aug 2021 15:39:19 -0400	[thread overview]
Message-ID: <YSVK5/DR74AE0iZr@t490s> (raw)
In-Reply-To: <CAMxuvawNsaL66nTiWaQa72D_kDzRPj_-AWnof4att6ghcBSZkQ@mail.gmail.com>

On Tue, Aug 24, 2021 at 10:04:19PM +0400, Marc-André Lureau wrote:
> Hi

Hello, Marc-Andre,

> 
> On Tue, Aug 24, 2021 at 7:27 PM Peter Xu <peterx@redhat.com> wrote:
> 
> > Both dump-guest-memory and live migration caches vm state at the beginning.
> > Either of them entering the other one will cause race on the vm state, and
> > even
> > more severe on that (please refer to the crash report in the bug link).
> >
> > Let's block live migration in dump-guest-memory, and that'll also block
> > dump-guest-memory if it detected that we're during a live migration.
> >
> 
> How does it detect that migration is in progress?

migrate_add_blocker() (and the new migrate_add_blocker_internal()) guaranteed
it; it will only succeed if there's no migration, and it should cover both
sides of migration (as I think migration_is_idle() should return true on both
src/dst when there's one):

    if (migration_is_idle()) {
        migration_blockers = g_slist_prepend(migration_blockers, reason);
        return 0;
    }

    error_propagate_prepend(errp, error_copy(reason),
                            "disallowing migration blocker "
                            "(migration in progress) for: ");
    return -EBUSY;

That's why I removed the old check on incoming migration:

-    if (runstate_check(RUN_STATE_INMIGRATE)) {
-        error_setg(errp, "Dump not allowed during incoming migration.");
-        return;
-    }

Because I think it'll cover that case too.

Thanks,

-- 
Peter Xu



  reply	other threads:[~2021-08-24 19:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 15:27 [PATCH 0/2] dump-guest-memory: Add blocker for migration Peter Xu
2021-08-24 15:27 ` [PATCH 1/2] migration: Add migrate_add_blocker_internal() Peter Xu
2021-08-24 18:04   ` Marc-André Lureau
2021-08-25  8:04   ` Juan Quintela
2021-08-24 15:27 ` [PATCH 2/2] dump-guest-memory: Block live migration Peter Xu
2021-08-24 18:04   ` Marc-André Lureau
2021-08-24 19:39     ` Peter Xu [this message]
2021-08-25  7:36   ` Marc-André Lureau
2021-08-25 20:48     ` Peter Xu
2021-08-25  7:54 ` [PATCH 0/2] dump-guest-memory: Add blocker for migration Markus Armbruster
2021-08-25 21:32   ` Peter Xu
2021-09-01 11:35     ` Markus Armbruster
2021-09-03 16:08       ` Peter Xu

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=YSVK5/DR74AE0iZr@t490s \
    --to=peterx@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=drjones@redhat.com \
    --cc=lsoaresp@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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.