linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: target-devel@vger.kernel.org, linux-scsi@vger.kernel.org,
	stefanha@redhat.com, jasowang@redhat.com, mst@redhat.com,
	sgarzare@redhat.com, virtualization@lists.linux-foundation.org
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH 2/5] vhost-scsi: Drop vhost_scsi_flush during endpoint clearing
Date: Wed, 22 Feb 2023 18:19:46 -0600	[thread overview]
Message-ID: <20230223001949.2884-3-michael.christie@oracle.com> (raw)
In-Reply-To: <20230223001949.2884-1-michael.christie@oracle.com>

We don't need to run vhost_scsi_flush at the end of
vhost_scsi_clear_endpoint, because a couple lines before this code
if there are any tpgs in vs_tpg we take every vq mutex and clear the vq
backend so know there will be no new IOs accessing the vs_tpg. And after
we clear the backend we run vhost_scsi_flush already so we know there are
no running cmds accessing the vs_tpg.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/vhost/scsi.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index c31659aa5466..502d64b53d9c 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1746,11 +1746,7 @@ vhost_scsi_clear_endpoint(struct vhost_scsi *vs,
 			vhost_scsi_destroy_vq_cmds(vq);
 		}
 	}
-	/*
-	 * Act as synchronize_rcu to make sure access to
-	 * old vs->vs_tpg is finished.
-	 */
-	vhost_scsi_flush(vs);
+
 	kfree(vs->vs_tpg);
 	vs->vs_tpg = NULL;
 	WARN_ON(vs->vs_events_nr);
-- 
2.25.1


  parent reply	other threads:[~2023-02-23  0:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23  0:19 [PATCH 0/5] vhost-scsi: Fix management operation hangs Mike Christie
2023-02-23  0:19 ` [PATCH 1/5] vhost-scsi: Hold tv_tpg_mutex when decrementing tv_tpg_vhost_count Mike Christie
2023-02-23  0:19 ` Mike Christie [this message]
2023-02-23  0:19 ` [PATCH 3/5] vhost-scsi: Remove vhost_scsi_mutex from port link/unlink Mike Christie
2023-03-19 15:48   ` Mike Christie
2023-02-23  0:19 ` [PATCH 4/5] vhost-scsi: Delay releasing our refcount on the tpg Mike Christie
2023-02-23  0:19 ` [PATCH 5/5] vhost-scsi: Reduce vhost_scsi_mutex use Mike Christie

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=20230223001949.2884-3-michael.christie@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=jasowang@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=sgarzare@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).