From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: "Prasad Pandit" <ppandit@redhat.com>,
qemu-devel@nongnu.org, farosas@suse.de, jasowang@redhat.com,
mcoqueli@redhat.com, "Prasad Pandit" <pjp@fedoraproject.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH v2 2/2] vhost-user: add a request-reply lock
Date: Thu, 29 Aug 2024 11:05:15 -0400 [thread overview]
Message-ID: <20240829104323-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <ZtCFxLfFKvojRD2u@x1n>
On Thu, Aug 29, 2024 at 10:29:24AM -0400, Peter Xu wrote:
> On Thu, Aug 29, 2024 at 02:45:45PM +0530, Prasad Pandit wrote:
> > Hello Michael,
> >
> > On Thu, 29 Aug 2024 at 13:12, Michael S. Tsirkin <mst@redhat.com> wrote:
> > > Weird. Seems to indicate some kind of deadlock?
> >
> > * Such a deadlock should occur across all environments I guess, not
> > sure why it happens selectively. It is strange.
> >
> > > So maybe vhost_user_postcopy_end should take the BQL?
> > ===
> > diff --git a/migration/savevm.c b/migration/savevm.c
> > index e7c1215671..31acda3818 100644
> > --- a/migration/savevm.c
> > +++ b/migration/savevm.c
> > @@ -2050,7 +2050,9 @@ static void *postcopy_ram_listen_thread(void *opaque)
> > */
> > qemu_event_wait(&mis->main_thread_load_event);
> > }
> > + bql_lock();
> > postcopy_ram_incoming_cleanup(mis);
> > + bql_unlock();
> >
> > if (load_res < 0) {
> > /*
> > ===
> >
> > * Actually a BQL patch above was tested and it worked fine. But not
> > sure if it is an acceptable solution. Another contention was taking
> > BQL could make things more complicated, so a local vhost-user specific
> > lock should be better.
> >
> > ...wdyt?
>
> I think Michael was suggesting taking bql in vhost_user_postcopy_end(), not
> in postcopy code directly.
maybe that's better, ok.
> I'm recently looking at how to make precopy
> load even take less bql and even make it a separate thread. Above is
> definitely going backwards, per we discussed already internally.
At the same time a small bugfix is better, can be backported.
> I cherish postcopy doesn't need to take bql on its own in most paths, and
> we shouldn't add unnecessary bql requirement even if vhost-user isn't used.
>
> Personally I still prefer we look into why a separate mutex won't work and
> why that timed out; that could be part of whoever is going to investigate
> the whole issue (including the hang later on). Otherwise I'm ok from
> migration pov that we take bql in the vhost-user hook, but not in savevm.c.
>
> Thanks,
ok
> --
> Peter Xu
next prev parent reply other threads:[~2024-08-29 15:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 10:09 [PATCH v2 0/2] Postcopy migration and vhost-user errors Prasad Pandit
2024-08-28 10:09 ` [PATCH v2 1/2] vhost: fail device start if iotlb update fails Prasad Pandit
2024-08-28 10:09 ` [PATCH v2 2/2] vhost-user: add a request-reply lock Prasad Pandit
2024-08-28 11:15 ` Michael S. Tsirkin
2024-08-29 5:39 ` Prasad Pandit
2024-08-29 6:23 ` Michael S. Tsirkin
2024-08-29 7:42 ` Michael S. Tsirkin
2024-08-29 9:15 ` Prasad Pandit
2024-08-29 9:21 ` Michael S. Tsirkin
2024-08-29 14:29 ` Peter Xu
2024-08-29 15:05 ` Michael S. Tsirkin [this message]
2024-08-29 20:29 ` Peter Xu
2024-09-10 17:10 ` [PATCH v2 0/2] Postcopy migration and vhost-user errors Michael S. Tsirkin
2024-09-11 7:14 ` Prasad Pandit
2024-09-11 9:46 ` Michael S. Tsirkin
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=20240829104323-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=dgilbert@redhat.com \
--cc=farosas@suse.de \
--cc=jasowang@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mcoqueli@redhat.com \
--cc=peterx@redhat.com \
--cc=pjp@fedoraproject.org \
--cc=ppandit@redhat.com \
--cc=qemu-devel@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).