public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Yishai Hadas <yishaih@nvidia.com>
Cc: alex.williamson@redhat.com, kvm@vger.kernel.org,
	kevin.tian@intel.com, joao.m.martins@oracle.com,
	leonro@nvidia.com, maorg@nvidia.com
Subject: Re: [PATCH vfio 0/9] Add chunk mode support for mlx5 driver
Date: Wed, 20 Sep 2023 15:31:23 -0300	[thread overview]
Message-ID: <20230920183123.GJ13733@nvidia.com> (raw)
In-Reply-To: <20230911093856.81910-1-yishaih@nvidia.com>

On Mon, Sep 11, 2023 at 12:38:47PM +0300, Yishai Hadas wrote:
> This series adds 'chunk mode' support for mlx5 driver upon the migration
> flow.
> 
> Before this series, we were limited to 4GB state size, as of the 4 bytes
> max value based on the device specification for the query/save/load
> commands.
> 
> Once the device supports 'chunk mode' the driver can support state size
> which is larger than 4GB.
> 
> In that case, the device has the capability to split a single image to
> multiple chunks as long as the software provides a buffer in the minimum
> size reported by the device.
> 
> The driver should query for the minimum buffer size required using
> QUERY_VHCA_MIGRATION_STATE command with the 'chunk' bit set in its
> input, in that case, the output will include both the minimum buffer
> size and also the remaining total size to be reported/used where it will
> be applicable.
> 
> Upon chunk mode, there may be multiple images that will be read from the
> device upon STOP_COPY. The driver will read ahead from the firmware the
> full state in small/optimized chunks while letting QEMU/user space read
> in parallel the available data.
> 
> The chunk buffer size is picked up based on the minimum size that
> firmware requires, the total full size and some max value in the driver
> code which was set to 8MB to achieve some optimized downtime in the
> general case.
> 
> With that series in place, we could migrate successfully a device state
> with a larger size than 4GB, while even improving the downtime in some
> scenarios.
> 
> Note:
> As the first patch should go to net/mlx5 we may need to send it as a
> pull request format to VFIO to avoid conflicts before acceptance.
> 
> Yishai
> 
> Yishai Hadas (9):
>   net/mlx5: Introduce ifc bits for migration in a chunk mode
>   vfio/mlx5: Wake up the reader post of disabling the SAVING migration
>     file
>   vfio/mlx5: Refactor the SAVE callback to activate a work only upon an
>     error
>   vfio/mlx5: Enable querying state size which is > 4GB
>   vfio/mlx5: Rename some stuff to match chunk mode
>   vfio/mlx5: Pre-allocate chunks for the STOP_COPY phase
>   vfio/mlx5: Add support for SAVING in chunk mode
>   vfio/mlx5: Add support for READING in chunk mode
>   vfio/mlx5: Activate the chunk mode functionality

I didn't check in great depth but this looks OK to me

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

I think this is a good design to start motivating more qmeu
improvements, eg using io_uring as we could go further in the driver
to optimize with that kind of support.

Jason

  parent reply	other threads:[~2023-09-20 18:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11  9:38 [PATCH vfio 0/9] Add chunk mode support for mlx5 driver Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 1/9] net/mlx5: Introduce ifc bits for migration in a chunk mode Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 2/9] vfio/mlx5: Wake up the reader post of disabling the SAVING migration file Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 3/9] vfio/mlx5: Refactor the SAVE callback to activate a work only upon an error Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 4/9] vfio/mlx5: Enable querying state size which is > 4GB Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 5/9] vfio/mlx5: Rename some stuff to match chunk mode Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 6/9] vfio/mlx5: Pre-allocate chunks for the STOP_COPY phase Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 7/9] vfio/mlx5: Add support for SAVING in chunk mode Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 8/9] vfio/mlx5: Add support for READING " Yishai Hadas
2023-09-11  9:38 ` [PATCH vfio 9/9] vfio/mlx5: Activate the chunk mode functionality Yishai Hadas
2023-09-20 18:31 ` Jason Gunthorpe [this message]
2023-09-27 10:59   ` [PATCH vfio 0/9] Add chunk mode support for mlx5 driver Yishai Hadas
2023-09-27 22:10     ` Alex Williamson
2023-09-28 11:08       ` Leon Romanovsky
2023-09-28 18:29         ` Alex Williamson
2023-09-28 18:42           ` Leon Romanovsky
2023-09-28 18:47             ` Alex Williamson
2023-09-28 18:51               ` Leon Romanovsky
2023-09-28 21:12                 ` Alex Williamson
2023-10-02  8:47 ` (subset) " Leon Romanovsky

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=20230920183123.GJ13733@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.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=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