From: Alex Williamson <alex.williamson@redhat.com>
To: Yishai Hadas <yishaih@nvidia.com>
Cc: <jgg@nvidia.com>, <kvm@vger.kernel.org>, <kevin.tian@intel.com>,
<joao.m.martins@oracle.com>, <leonro@nvidia.com>,
<shayd@nvidia.com>, <maorg@nvidia.com>, <avihaih@nvidia.com>,
<cohuck@redhat.com>,
Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Subject: Re: [PATCH V2 vfio 02/14] vfio: Extend the device migration protocol with PRE_COPY
Date: Thu, 1 Dec 2022 15:43:46 -0700 [thread overview]
Message-ID: <20221201154346.58e49361.alex.williamson@redhat.com> (raw)
In-Reply-To: <20221201152931.47913-3-yishaih@nvidia.com>
On Thu, 1 Dec 2022 17:29:19 +0200
Yishai Hadas <yishaih@nvidia.com> wrote:
> From: Jason Gunthorpe <jgg@nvidia.com>
>
> The optional PRE_COPY states open the saving data transfer FD before
> reaching STOP_COPY and allows the device to dirty track internal state
> changes with the general idea to reduce the volume of data transferred
> in the STOP_COPY stage.
>
> While in PRE_COPY the device remains RUNNING, but the saving FD is open.
>
> Only if the device also supports RUNNING_P2P can it support PRE_COPY_P2P,
> which halts P2P transfers while continuing the saving FD.
>
> PRE_COPY, with P2P support, requires the driver to implement 7 new arcs
> and exists as an optional FSM branch between RUNNING and STOP_COPY:
> RUNNING -> PRE_COPY -> PRE_COPY_P2P -> STOP_COPY
>
> A new ioctl VFIO_MIG_GET_PRECOPY_INFO is provided to allow userspace to
> query the progress of the precopy operation in the driver with the idea it
> will judge to move to STOP_COPY at least once the initial data set is
> transferred, and possibly after the dirty size has shrunk appropriately.
>
> This ioctl is valid only in PRE_COPY states and kernel driver should
> return -EINVAL from any other migration state.
>
> Compared to the v1 clarification, STOP_COPY -> PRE_COPY is blocked
> and to be defined in future.
> We also split the pending_bytes report into the initial and sustaining
> values, e.g.: initial_bytes and dirty_bytes.
> initial_bytes: Amount of initial precopy data.
> dirty_bytes: Device state changes relative to data previously retrieved.
> These fields are not required to have any bearing to STOP_COPY phase.
>
> It is recommended to leave PRE_COPY for STOP_COPY only after the
> initial_bytes field reaches zero. Leaving PRE_COPY earlier might make
> things slower.
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Shay Drory <shayd@nvidia.com>
> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> ---
> drivers/vfio/vfio_main.c | 74 ++++++++++++++++++++++-
> include/uapi/linux/vfio.h | 122 ++++++++++++++++++++++++++++++++++++--
> 2 files changed, 190 insertions(+), 6 deletions(-)
This looks ok to me, so if you want to provide a branch for the first
patch we can move forward with the rest through the vfio tree as was
mentioned.
Comments and reviews still welcome, particularly I expect Shameer has
already reviewed this for the hisi-acc implementation. Thanks,
Alex
next prev parent reply other threads:[~2022-12-01 22:44 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 15:29 [PATCH V2 vfio 00/14] Add migration PRE_COPY support for mlx5 driver Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 01/14] net/mlx5: Introduce ifc bits for pre_copy Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 02/14] vfio: Extend the device migration protocol with PRE_COPY Yishai Hadas
2022-12-01 22:43 ` Alex Williamson [this message]
2022-12-04 7:38 ` Leon Romanovsky
2022-12-02 8:48 ` Tian, Kevin
2022-12-04 8:35 ` Yishai Hadas
2022-12-02 9:38 ` Shameerali Kolothum Thodi
2022-12-05 13:54 ` Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 03/14] vfio/mlx5: Enforce a single SAVE command at a time Yishai Hadas
2022-12-02 0:51 ` Jason Gunthorpe
2022-12-04 12:07 ` Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 04/14] vfio/mlx5: Refactor PD usage Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 05/14] vfio/mlx5: Refactor MKEY usage Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 06/14] vfio/mlx5: Refactor migration file state Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 07/14] vfio/mlx5: Refactor to use queue based data chunks Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 08/14] vfio/mlx5: Introduce device transitions of PRE_COPY Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 09/14] vfio/mlx5: Introduce SW headers for migration states Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 10/14] vfio/mlx5: Introduce vfio precopy ioctl implementation Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 11/14] vfio/mlx5: Consider temporary end of stream as part of PRE_COPY Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 12/14] vfio/mlx5: Introduce multiple loads Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 13/14] vfio/mlx5: Fallback to STOP_COPY upon specific PRE_COPY error Yishai Hadas
2022-12-01 15:29 ` [PATCH V2 vfio 14/14] vfio/mlx5: Enable MIGRATION_PRE_COPY flag Yishai Hadas
2022-12-02 1:06 ` [PATCH V2 vfio 00/14] Add migration PRE_COPY support for mlx5 driver Jason Gunthorpe
2022-12-02 8:57 ` Tian, Kevin
2022-12-04 11:54 ` Yishai Hadas
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=20221201154346.58e49361.alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=avihaih@nvidia.com \
--cc=cohuck@redhat.com \
--cc=jgg@nvidia.com \
--cc=joao.m.martins@oracle.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=leonro@nvidia.com \
--cc=maorg@nvidia.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shayd@nvidia.com \
--cc=yishaih@nvidia.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