kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Dongli Zhang <dongli.zhang@oracle.com>,
	virtualization@lists.linux.dev, kvm@vger.kernel.org,
	netdev@vger.kernel.org
Cc: mst@redhat.com, jasowang@redhat.com, pbonzini@redhat.com,
	stefanha@redhat.com, eperezma@redhat.com,
	joao.m.martins@oracle.com, joe.jin@oracle.com,
	si-wei.liu@oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 6/9] vhost-scsi: log I/O queue write descriptors
Date: Sun, 6 Apr 2025 16:41:35 -0500	[thread overview]
Message-ID: <eafb0c10-3393-4372-bf2c-7cc7d2a7b11a@oracle.com> (raw)
In-Reply-To: <20250403063028.16045-7-dongli.zhang@oracle.com>

On 4/3/25 1:29 AM, Dongli Zhang wrote:
> Log write descriptors for the I/O queue, leveraging vhost_scsi_get_desc()
> and vhost_get_vq_desc() to retrieve the array of write descriptors to
> obtain the log buffer.
> 
> In addition, introduce a vhost-scsi specific function to log vring
> descriptors. In this function, the 'partial' argument is set to false, and
> the 'len' argument is set to 0, because vhost-scsi always logs all pages
> shared by a vring descriptor. Add WARN_ON_ONCE() since vhost-scsi doesn't
> support VIRTIO_F_ACCESS_PLATFORM.
> 
> The per-cmd log buffer is allocated on demand in the submission path after
> VHOST_F_LOG_ALL is set. Return -ENOMEM on allocation failure, in order to
> send SAM_STAT_TASK_SET_FULL to the guest.
> 
> It isn't reclaimed in the completion path. Instead, it is reclaimed when
> VHOST_F_LOG_ALL is removed, or during VHOST_SCSI_SET_ENDPOINT when all
> commands are destroyed.
> 
> Store the log buffer during the submission path and log it in the
> completion path. Logging is also required in the error handling path of the
> submission process.
> 
> Suggested-by: Joao Martins <joao.m.martins@oracle.com>
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
> ---
> Changed since v1:
>   - Don't allocate log buffer during initialization. Allocate during
>   - VHOST_SET_FEATURES or VHOST_SCSI_SET_ENDPOINT.
>   - Re-order if staments in vhost_scsi_log_write().
>   - Log after vhost_scsi_send_status() as well.
> Changed since v2:
>   - Merge PATCH 6 and PATCH 7 from v2 as one patch.
>   - Don't pre-allocate log buffer in
>     VHOST_SET_FEATURES/VHOST_SCSI_SET_ENDPOINT. Allocate for only once in
>     submission path in runtime. Reclaim int
>     VHOST_SET_FEATURES/VHOST_SCSI_SET_ENDPOINT.
>   - Encapsulate the one-time on-demand per-cmd log buffer alloc/copy in a
>     helper, as suggested by Mike.
Reviewed-by: Mike Christie <michael.christie@oracle.com>

  reply	other threads:[~2025-04-06 21:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03  6:29 [PATCH v3 0/9] vhost-scsi: log write descriptors for live migration (and three bugfix) Dongli Zhang
2025-04-03  6:29 ` [PATCH v3 1/9] vhost-scsi: protect vq->log_used with vq->mutex Dongli Zhang
2025-04-03  6:29 ` [PATCH v3 2/9] vhost-scsi: Fix vhost_scsi_send_bad_target() Dongli Zhang
2025-04-03  6:29 ` [PATCH v3 3/9] vhost-scsi: Fix vhost_scsi_send_status() Dongli Zhang
2025-04-03  6:29 ` [PATCH v3 4/9] vhost: modify vhost_log_write() for broader users Dongli Zhang
2025-04-16  7:58   ` Dongli Zhang
2025-04-21  3:08   ` Jason Wang
2025-04-03  6:29 ` [PATCH v3 5/9] vhost-scsi: adjust vhost_scsi_get_desc() to log vring descriptors Dongli Zhang
2025-04-03  6:29 ` [PATCH v3 6/9] vhost-scsi: log I/O queue write descriptors Dongli Zhang
2025-04-06 21:41   ` Mike Christie [this message]
2025-04-03  6:29 ` [PATCH v3 7/9] vhost-scsi: log control " Dongli Zhang
2025-04-06 21:43   ` Mike Christie
2025-04-03  6:29 ` [PATCH v3 8/9] vhost-scsi: log event " Dongli Zhang
2025-04-03  6:29 ` [PATCH v3 9/9] vhost: add WARNING if log_num is more than limit Dongli Zhang
2025-04-14 16:32   ` Michael S. Tsirkin
2025-04-14 16:52     ` Dongli Zhang
2025-04-14 18:39       ` Michael S. Tsirkin
2025-04-14 20:52         ` Dongli Zhang

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=eafb0c10-3393-4372-bf2c-7cc7d2a7b11a@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=dongli.zhang@oracle.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=joao.m.martins@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=si-wei.liu@oracle.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux.dev \
    /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).