qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Hanna Czenczek <hreitz@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org,  virtio-fs@redhat.com,
	German Maglione <gmaglione@redhat.com>,
	 Anton Kuchin <antonkuchin@yandex-team.ru>,
	Juan Quintela <quintela@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [PATCH 2/4] vhost-user: Interface for migration state transfer
Date: Wed, 19 Apr 2023 06:57:44 -0400	[thread overview]
Message-ID: <CAJSP0QWJJn7=Ck_5TCnGd5DLx9Rwmr_SvS2+nU89eU1A8=pUSQ@mail.gmail.com> (raw)
In-Reply-To: <e4cc0882-c6e0-a830-45d6-e3aab398ab98@redhat.com>

On Wed, 19 Apr 2023 at 06:45, Hanna Czenczek <hreitz@redhat.com> wrote:
>
> On 14.04.23 17:17, Eugenio Perez Martin wrote:
> > On Thu, Apr 13, 2023 at 7:55 PM Hanna Czenczek <hreitz@redhat.com> wrote:
>
> [...]
>
> >> Basically, what I’m hearing is that I need to implement a different
> >> feature that has no practical impact right now, and also fix bugs around
> >> it along the way...
> >>
> > To fix this properly requires iterative device migration in qemu as
> > far as I know, instead of using VMStates [1]. This way the state is
> > requested to virtiofsd before the device reset.
> >
> > What does virtiofsd do when the state is totally sent? Does it keep
> > processing requests and generating new state or is only a one shot
> > that will suspend the daemon? If it is the second I think it still can
> > be done in one shot at the end, always indicating "no more state" at
> > save_live_pending and sending all the state at
> > save_live_complete_precopy.
>
> This sounds to me as if we should reset all devices during migration,
> and I don’t understand that.  virtiofsd will not immediately process
> requests when the state is sent, because the device is still stopped,
> but when it is re-enabled (e.g. because of a failed migration), it will
> have retained its state and continue processing requests as if nothing
> happened.  A reset would break this and other stateful back-ends, as I
> think Stefan has mentioned somewhere else.
>
> It seems to me as if there are devices that need a reset, and so need
> suspend+resume around it, but I also think there are back-ends that
> don’t, where this would only unnecessarily complicate the back-end
> implementation.

Existing vhost-user backends must continue working, so I think having
two code paths is (almost) unavoidable.

One approach is to add SUSPEND/RESUME to the vhost-user protocol with
a corresponding VHOST_USER_PROTOCOL_F_SUSPEND feature bit. vhost-user
frontends can identify backends that support SUSPEND/RESUME instead of
device reset. Old vhost-user backends will continue to use device
reset.

I said avoiding two code paths is almost unavoidable. It may be
possible to rely on existing VHOST_USER_GET_VRING_BASE's semantics (it
stops a single virtqueue) instead of SUSPEND. RESUME is replaced by
VHOST_USER_SET_VRING_* and gets the device going again. However, I'm
not 100% sure if this will work (even for all existing devices). It
would require carefully studying both the spec and various
implementations to see if it's viable. There's a chance of losing the
performance optimization that VHOST_USER_SET_STATUS provided to DPDK
if the device is not reset.

In my opinion SUSPEND/RESUME is the cleanest way to do this.

Stefan


  reply	other threads:[~2023-04-19 10:59 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 15:05 [PATCH 0/4] vhost-user-fs: Internal migration Hanna Czenczek
2023-04-11 15:05 ` [PATCH 1/4] vhost: Re-enable vrings after setting features Hanna Czenczek
2023-04-12 10:55   ` German Maglione
2023-04-12 12:18     ` Hanna Czenczek
2023-04-12 20:51   ` Stefan Hajnoczi
2023-04-13  7:17     ` Maxime Coquelin
2023-04-13  8:19     ` Hanna Czenczek
2023-04-13 11:03       ` Stefan Hajnoczi
2023-04-13 14:24         ` Anton Kuchin
2023-04-13 15:48           ` Michael S. Tsirkin
2023-04-13 11:03   ` Stefan Hajnoczi
2023-04-13 17:32     ` Hanna Czenczek
2023-04-13 13:19   ` Michael S. Tsirkin
2023-04-11 15:05 ` [PATCH 2/4] vhost-user: Interface for migration state transfer Hanna Czenczek
2023-04-12 21:06   ` Stefan Hajnoczi
2023-04-13  9:24     ` Hanna Czenczek
2023-04-13 11:38       ` Stefan Hajnoczi
2023-04-13 17:55         ` Hanna Czenczek
2023-04-13 20:42           ` Stefan Hajnoczi
2023-04-14 15:17           ` Eugenio Perez Martin
2023-04-17 15:18             ` Stefan Hajnoczi
2023-04-17 18:55               ` Eugenio Perez Martin
2023-04-17 19:08                 ` Stefan Hajnoczi
2023-04-17 19:11                   ` Eugenio Perez Martin
2023-04-17 19:46                     ` Stefan Hajnoczi
2023-04-18 10:09                       ` Eugenio Perez Martin
2023-04-19 10:45             ` Hanna Czenczek
2023-04-19 10:57               ` Stefan Hajnoczi [this message]
2023-04-13 10:14     ` Eugenio Perez Martin
2023-04-13 11:07       ` Stefan Hajnoczi
2023-04-13 17:31       ` Hanna Czenczek
2023-04-17 15:12         ` Stefan Hajnoczi
2023-04-19 10:47           ` Hanna Czenczek
2023-04-17 18:37         ` Eugenio Perez Martin
2023-04-17 15:38       ` Stefan Hajnoczi
2023-04-17 19:09         ` Eugenio Perez Martin
2023-04-17 19:33           ` Stefan Hajnoczi
2023-04-18  8:09             ` Eugenio Perez Martin
2023-04-18 17:59               ` Stefan Hajnoczi
2023-04-18 18:31                 ` Eugenio Perez Martin
2023-04-18 20:40                   ` Stefan Hajnoczi
2023-04-20 13:27                     ` Eugenio Pérez
2023-05-08 19:12                       ` Stefan Hajnoczi
2023-05-09  6:31                         ` Eugenio Perez Martin
2023-05-09  9:01                           ` Hanna Czenczek
2023-05-09 15:26                             ` Eugenio Perez Martin
2023-04-19 10:57                 ` [Virtio-fs] " Hanna Czenczek
2023-04-19 11:10                   ` Stefan Hajnoczi
2023-04-19 11:15                     ` Hanna Czenczek
2023-04-19 11:24                       ` Stefan Hajnoczi
2023-04-17 17:14       ` Stefan Hajnoczi
2023-04-17 19:06         ` Eugenio Perez Martin
2023-04-17 19:20           ` Stefan Hajnoczi
2023-04-18  7:54             ` Eugenio Perez Martin
2023-04-19 11:10               ` Hanna Czenczek
2023-04-19 11:21                 ` Stefan Hajnoczi
2023-04-19 11:24                   ` Hanna Czenczek
2023-04-20 13:29                   ` Eugenio Pérez
2023-05-08 20:10                     ` Stefan Hajnoczi
2023-05-09  6:45                       ` Eugenio Perez Martin
2023-05-09 15:09                         ` Stefan Hajnoczi
2023-05-09 15:35                           ` Eugenio Perez Martin
2023-05-09 17:33                             ` Stefan Hajnoczi
2023-04-20 10:44                 ` Eugenio Pérez
2023-04-13  8:50   ` Eugenio Perez Martin
2023-04-13  9:25     ` Hanna Czenczek
2023-04-11 15:05 ` [PATCH 3/4] vhost: Add high-level state save/load functions Hanna Czenczek
2023-04-12 21:14   ` Stefan Hajnoczi
2023-04-13  9:04     ` Hanna Czenczek
2023-04-13 11:22       ` Stefan Hajnoczi
2023-04-11 15:05 ` [PATCH 4/4] vhost-user-fs: Implement internal migration Hanna Czenczek
2023-04-12 21:00 ` [PATCH 0/4] vhost-user-fs: Internal migration Stefan Hajnoczi
2023-04-13  8:20   ` Hanna Czenczek
2023-04-13 16:11 ` Michael S. Tsirkin
2023-04-13 17:53   ` [Virtio-fs] " Hanna Czenczek
2023-05-04 16:05 ` Hanna Czenczek
2023-05-04 21:14   ` Stefan Hajnoczi
2023-05-05  9:03     ` Hanna Czenczek
2023-05-05  9:51       ` Hanna Czenczek
2023-05-05 14:26         ` Eugenio Perez Martin
2023-05-05 14:37           ` Hanna Czenczek
2023-05-08 17:00             ` Hanna Czenczek
2023-05-08 17:51               ` Eugenio Perez Martin
2023-05-08 19:31                 ` Eugenio Perez Martin
2023-05-09  8:59                   ` Hanna Czenczek
2023-05-09 15:30           ` Stefan Hajnoczi
2023-05-09 15:43             ` Eugenio Perez Martin
2023-05-05  9:53       ` Eugenio Perez Martin
2023-05-05 12:51         ` Hanna Czenczek
2023-05-08 21:10           ` Stefan Hajnoczi
2023-05-09  8:53             ` Hanna Czenczek
2023-05-09 14:53               ` Stefan Hajnoczi
2023-05-09 15:41       ` Stefan Hajnoczi

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='CAJSP0QWJJn7=Ck_5TCnGd5DLx9Rwmr_SvS2+nU89eU1A8=pUSQ@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=antonkuchin@yandex-team.ru \
    --cc=eperezma@redhat.com \
    --cc=gmaglione@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-fs@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).