virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	Mike Christie <michael.christie@oracle.com>
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	target-devel@vger.kernel.org, stefanha@redhat.com
Subject: Re: [PATCH 09/17] vhost scsi: fix cmd completion race
Date: Fri, 30 Oct 2020 17:04:12 +0100	[thread overview]
Message-ID: <5c319f1a-cf4c-f522-ecde-5b6b5a2e1ddd@redhat.com> (raw)
In-Reply-To: <20201030045053-mutt-send-email-mst@kernel.org>

On 30/10/20 09:51, Michael S. Tsirkin wrote:
> On Wed, Oct 21, 2020 at 07:34:55PM -0500, Mike Christie wrote:
>> We might not do the final se_cmd put from vhost_scsi_complete_cmd_work.
>> When the last put happens a little later then we could race where
>> vhost_scsi_complete_cmd_work does vhost_signal, the guest runs and sends
>> more IO, and vhost_scsi_handle_vq runs but does not find any free cmds.
>>
>> This patch has us delay completing the cmd until the last lio core ref
>> is dropped. We then know that once we signal to the guest that the cmd
>> is completed that if it queues a new command it will find a free cmd.
>>
>> Signed-off-by: Mike Christie <michael.christie@oracle.com>
> 
> Paolo, could you review this one?

I don't know how LIO does all the callbacks, honestly (I have only ever
worked on the virtio-scsi driver, not vhost-scsi, and I have only ever
reviewed some virtio-scsi spec bits of vhost-scsi).

The vhost_scsi_complete_cmd_work parts look fine, but I have no idea why
vhost_scsi_queue_data_in and vhost_scsi_queue_status call.

Paolo

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

      reply	other threads:[~2020-10-30 16:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1603326903-27052-1-git-send-email-michael.christie@oracle.com>
     [not found] ` <1603326903-27052-5-git-send-email-michael.christie@oracle.com>
2020-10-22  5:22   ` [PATCH 04/17] vhost: prep vhost_dev_init users to handle failures kernel test robot
2020-11-02  5:57   ` Jason Wang
2020-11-03 10:04   ` Dan Carpenter
     [not found] ` <1603326903-27052-2-git-send-email-michael.christie@oracle.com>
2020-10-26  3:33   ` [PATCH 01/17] vhost scsi: add lun parser helper Jason Wang
     [not found] ` <1603326903-27052-4-git-send-email-michael.christie@oracle.com>
2020-10-26  3:34   ` [PATCH 03/17] vhost net: use goto error handling in open Jason Wang
     [not found] ` <1603326903-27052-8-git-send-email-michael.christie@oracle.com>
2020-10-26  3:51   ` [PATCH 07/17] vhost scsi: support delayed IO vq creation Jason Wang
     [not found]     ` <49c2fc29-348c-06db-4823-392f7476d318@oracle.com>
2020-10-28  1:55       ` Jason Wang
2020-10-30  8:47       ` Michael S. Tsirkin
2020-11-02  6:36         ` Jason Wang
2020-11-02  6:49           ` Jason Wang
2020-10-29 21:47 ` [PATCH 00/17 V3] vhost: fix scsi cmd handling and cgroup support Michael S. Tsirkin
     [not found] ` <1603326903-27052-10-git-send-email-michael.christie@oracle.com>
2020-10-30  8:51   ` [PATCH 09/17] vhost scsi: fix cmd completion race Michael S. Tsirkin
2020-10-30 16:04     ` Paolo Bonzini [this message]

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=5c319f1a-cf4c-f522-ecde-5b6b5a2e1ddd@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=mst@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=target-devel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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).