From: Peter Xu <peterx@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org,
"Daniel P . Berrange" <berrange@redhat.com>,
Leonardo Bras Soares Passos <lsoaresp@redhat.com>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH 1/5] migration: Fix possible deadloop of ram save process
Date: Tue, 4 Oct 2022 10:25:53 -0400 [thread overview]
Message-ID: <YzxCcdPSewXDDwB+@x1n> (raw)
In-Reply-To: <YyyQOlxaSHRbZIK6@work-vm>
On Thu, Sep 22, 2022 at 05:41:30PM +0100, Dr. David Alan Gilbert wrote:
> * Peter Xu (peterx@redhat.com) wrote:
> > On Thu, Sep 22, 2022 at 03:49:38PM +0100, Dr. David Alan Gilbert wrote:
> > > * Peter Xu (peterx@redhat.com) wrote:
> > > > When starting ram saving procedure (especially at the completion phase),
> > > > always set last_seen_block to non-NULL to make sure we can always correctly
> > > > detect the case where "we've migrated all the dirty pages".
> > > >
> > > > Then we'll guarantee both last_seen_block and pss.block will be valid
> > > > always before the loop starts.
> > > >
> > > > See the comment in the code for some details.
> > > >
> > > > Signed-off-by: Peter Xu <peterx@redhat.com>
> > >
> > > Yeh I guess it can currently only happen during restart?
> >
> > There're only two places to clear last_seen_block:
> >
> > ram_state_reset[2683] rs->last_seen_block = NULL;
> > ram_postcopy_send_discard_bitmap[2876] rs->last_seen_block = NULL;
> >
> > Where for the reset case:
> >
> > ram_state_init[2994] ram_state_reset(*rsp);
> > ram_state_resume_prepare[3110] ram_state_reset(rs);
> > ram_save_iterate[3271] ram_state_reset(rs);
> >
> > So I think it can at least happen in two places, either (1) postcopy just
> > started (assume when postcopy starts accidentally when all dirty pages were
> > migrated?), or (2) postcopy recover from failure.
>
> Oh, (1) is a more general problem then; yeh.
>
> > In my case I triggered this deadloop when I was debugging the other bug
> > fixed by the next patch where it was postcopy recovery (on tls), but only
> > once.. So currently I'm still not 100% sure whether this is the same
> > problem, but logically it could trigger.
> >
> > I also remember I used to hit very rare deadloops before too, maybe they're
> > the same thing because I did test recovery a lot.
>
> Note; 'deadlock' not 'deadloop'.
(Oops I somehow forgot there's still this series pending..)
Here it's not about a lock, or maybe I should add a space ("dead loop")?
--
Peter Xu
next prev parent reply other threads:[~2022-10-04 15:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 22:37 [PATCH 0/5] migration: Bug fixes (prepare for preempt-full) Peter Xu
2022-09-20 22:37 ` [PATCH 1/5] migration: Fix possible deadloop of ram save process Peter Xu
2022-09-22 14:49 ` Dr. David Alan Gilbert
2022-09-22 15:25 ` Peter Xu
2022-09-22 16:41 ` Dr. David Alan Gilbert
2022-10-04 14:25 ` Peter Xu [this message]
2022-10-04 15:02 ` Dr. David Alan Gilbert
2022-09-20 22:37 ` [PATCH 2/5] migration: Fix race on qemu_file_shutdown() Peter Xu
2022-09-22 15:43 ` Dr. David Alan Gilbert
2022-09-22 16:58 ` Daniel P. Berrangé
2022-09-22 19:37 ` Peter Xu
2022-09-23 7:14 ` Daniel P. Berrangé
2022-09-23 18:27 ` Peter Xu
2022-09-20 22:37 ` [PATCH 3/5] migration: Disallow xbzrle with postcopy Peter Xu
2022-09-22 15:56 ` Dr. David Alan Gilbert
2022-09-22 19:28 ` Peter Xu
2022-09-20 22:37 ` [PATCH 4/5] migration: Disallow postcopy preempt to be used with compress Peter Xu
2022-09-22 16:29 ` Dr. David Alan Gilbert
2022-09-20 22:38 ` [PATCH 5/5] migration: Use non-atomic ops for clear log bitmap 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=YzxCcdPSewXDDwB+@x1n \
--to=peterx@redhat.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=lsoaresp@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 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).