From: Steven Sistare <steven.sistare@oracle.com>
To: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org,
"Michael S. Tsirkin" <mst@redhat.com>,
Si-Wei Liu <si-wei.liu@oracle.com>,
Eugenio Perez Martin <eperezma@redhat.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Dragos Tatulea <dtatulea@nvidia.com>, Eli Cohen <elic@nvidia.com>,
Xie Yongji <xieyongji@bytedance.com>
Subject: Re: [RFC V1 00/13] vdpa live update
Date: Wed, 17 Jan 2024 15:31:36 -0500 [thread overview]
Message-ID: <aea1681c-e04d-4678-b161-6dbd2b13b82e@oracle.com> (raw)
In-Reply-To: <CACGkMEuFTRBYU+z3ZSWzMMv2650PQ=kduGxcGXaf0T5222Bh4g@mail.gmail.com>
On 1/10/2024 9:55 PM, Jason Wang wrote:
> On Thu, Jan 11, 2024 at 4:40 AM Steve Sistare <steven.sistare@oracle.com> wrote:
>>
>> Live update is a technique wherein an application saves its state, exec's
>> to an updated version of itself, and restores its state. Clients of the
>> application experience a brief suspension of service, on the order of
>> 100's of milliseconds, but are otherwise unaffected.
>>
>> Define and implement interfaces that allow vdpa devices to be preserved
>> across fork or exec, to support live update for applications such as qemu.
>> The device must be suspended during the update, but its dma mappings are
>> preserved, so the suspension is brief.
>>
>> The VHOST_NEW_OWNER ioctl transfers device ownership and pinned memory
>> accounting from one process to another.
>>
>> The VHOST_BACKEND_F_NEW_OWNER backend capability indicates that
>> VHOST_NEW_OWNER is supported.
>>
>> The VHOST_IOTLB_REMAP message type updates a dma mapping with its userland
>> address in the new process.
>>
>> The VHOST_BACKEND_F_IOTLB_REMAP backend capability indicates that
>> VHOST_IOTLB_REMAP is supported and required. Some devices do not
>> require it, because the userland address of each dma mapping is discarded
>> after being translated to a physical address.
>>
>> Here is a pseudo-code sequence for performing live update, based on
>> suspend + reset because resume is not yet available. The vdpa device
>> descriptor, fd, remains open across the exec.
>>
>> ioctl(fd, VHOST_VDPA_SUSPEND)
>> ioctl(fd, VHOST_VDPA_SET_STATUS, 0)
>> exec
>
> Is there a userspace implementation as a reference?
I have working patches for qemu that use these ioctl's, but they depend on other
qemu cpr patches that are a work in progress, and not posted yet. I'm working on
that.
>> ioctl(fd, VHOST_NEW_OWNER)
>>
>> issue ioctls to re-create vrings
>>
>> if VHOST_BACKEND_F_IOTLB_REMAP
>> foreach dma mapping
>> write(fd, {VHOST_IOTLB_REMAP, new_addr})
>
> I think I need to understand the advantages of this approach. For
> example, why it is better than
>
> ioctl(VHOST_RESET_OWNER)
> exec
>
> ioctl(VHOST_SET_OWNER)
>
> for each dma mapping
> ioctl(VHOST_IOTLB_UPDATE)
That is slower. VHOST_RESET_OWNER unbinds physical pages, and VHOST_IOTLB_UPDATE
rebinds them. It costs multiple seconds for large memories, and is incurred during the
virtual machine's pause time during live update. For comparison, the total pause time
for live update with vfio interfaces is ~100 millis.
However, the interaction with userland is so similar that the same code paths can be used.
In my qemu prototype, after cpr exec's new qemu:
- vhost_vdpa_set_owner() calls VHOST_NEW_OWNER instead of VHOST_SET_OWNER
- vhost_vdpa_dma_map() sets type VHOST_IOTLB_REMAP instead of VHOST_IOTLB_UPDATE
- Steve
next prev parent reply other threads:[~2024-01-17 20:31 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 20:40 [RFC V1 00/13] vdpa live update Steve Sistare
2024-01-10 20:40 ` [RFC V1 01/13] vhost-vdpa: count pinned memory Steve Sistare
2024-01-10 22:24 ` Michael S. Tsirkin
2024-01-17 20:34 ` Steven Sistare
2024-01-10 20:40 ` [RFC V1 02/13] vhost-vdpa: pass mm to bind Steve Sistare
2024-01-10 20:40 ` [RFC V1 03/13] vhost-vdpa: VHOST_NEW_OWNER Steve Sistare
2024-01-10 20:40 ` [RFC V1 04/13] vhost-vdpa: VHOST_BACKEND_F_NEW_OWNER Steve Sistare
2024-01-10 20:40 ` [RFC V1 05/13] vhost-vdpa: VHOST_IOTLB_REMAP Steve Sistare
2024-01-11 3:08 ` Jason Wang
2024-01-17 20:31 ` Steven Sistare
2024-01-22 4:05 ` Jason Wang
2024-01-16 18:14 ` Eugenio Perez Martin
2024-02-09 15:49 ` Steven Sistare
2024-01-10 20:40 ` [RFC V1 06/13] vhost-vdpa: VHOST_BACKEND_F_IOTLB_REMAP Steve Sistare
2024-01-10 20:40 ` [RFC V1 07/13] vhost-vdpa: flush workers on suspend Steve Sistare
2024-01-11 3:09 ` Jason Wang
2024-01-11 16:17 ` Mike Christie
2024-01-12 2:28 ` Jason Wang
2024-01-17 20:30 ` Steven Sistare
2024-01-10 20:40 ` [RFC V1 08/13] vduse: " Steve Sistare
2024-01-11 3:09 ` Jason Wang
2024-01-17 20:31 ` Steven Sistare
2024-01-10 20:40 ` [RFC V1 09/13] vdpa_sim: reset must not run Steve Sistare
2024-01-16 18:33 ` Eugenio Perez Martin
2024-01-10 20:40 ` [RFC V1 10/13] vdpa_sim: flush workers on suspend Steve Sistare
2024-01-16 18:57 ` Eugenio Perez Martin
2024-01-17 20:31 ` Steven Sistare
2024-01-10 20:40 ` [RFC V1 11/13] vdpa/mlx5: new owner capability Steve Sistare
2024-01-10 20:40 ` [RFC V1 12/13] vdpa_sim: " Steve Sistare
2024-01-10 20:40 ` [RFC V1 13/13] vduse: " Steve Sistare
2024-01-11 2:55 ` [RFC V1 00/13] vdpa live update Jason Wang
2024-01-17 20:31 ` Steven Sistare [this message]
2024-01-22 4:12 ` Jason Wang
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=aea1681c-e04d-4678-b161-6dbd2b13b82e@oracle.com \
--to=steven.sistare@oracle.com \
--cc=dtatulea@nvidia.com \
--cc=elic@nvidia.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=si-wei.liu@oracle.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=xieyongji@bytedance.com \
--cc=xuanzhuo@linux.alibaba.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.