public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Duncan <lduncan@suse.com>
To: Mike Christie <michael.christie@oracle.com>,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	mrangankar@marvell.com, njavali@marvell.com,
	GR-QLogic-Storage-Upstream@marvell.com, cleech@redhat.com,
	liuzhengyuang521@gmail.com
Subject: Re: [PATCH 2/6] scsi: iscsi: Speed up session unblocking and removal.
Date: Mon, 28 Feb 2022 08:05:59 -0800	[thread overview]
Message-ID: <d7a2c1d3-ea5c-5da3-e656-017390af015f@suse.com> (raw)
In-Reply-To: <20220226230435.38733-3-michael.christie@oracle.com>

On 2/26/22 15:04, Mike Christie wrote:
> When the iscsi class was added upstream blocking a queue was fast because
> it just set some flag bits and didn't handle IO that was in the process
> of being sent to the driver. That's no longer the case so blocking a queue
> is expensive and we can end up with a backlog of blocks by the time we
> have relogged in and are trying to start the queues.
> 
> For the session unblock case, this has try to cancel the block and
> recovery work in case they are still queued so we can avoid unneeded queue
> manipulations. For removal we also now try to cancel all the recovery
> related works since a couple lines down we will set the session and device
> state so running those functions are not necessary.
> 
> Signed-off-by: Mike Christie <michael.christie@oracle.com>
> ---
>   drivers/scsi/scsi_transport_iscsi.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index c58126e8cd88..732938f5436b 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -1944,7 +1944,8 @@ static void __iscsi_unblock_session(struct work_struct *work)
>    */
>   void iscsi_unblock_session(struct iscsi_cls_session *session)
>   {
> -	flush_work(&session->block_work);
> +	if (!cancel_work_sync(&session->block_work))
> +		cancel_delayed_work_sync(&session->recovery_work);
>   
>   	queue_work(iscsi_eh_timer_workq, &session->unblock_work);
>   	/*
> @@ -2177,9 +2178,9 @@ void iscsi_remove_session(struct iscsi_cls_session *session)
>   		list_del(&session->sess_list);
>   	spin_unlock_irqrestore(&sesslock, flags);
>   
> -	flush_work(&session->block_work);
> -	flush_work(&session->unblock_work);
> -	cancel_delayed_work_sync(&session->recovery_work);
> +	if (!cancel_work_sync(&session->block_work))
> +		cancel_delayed_work_sync(&session->recovery_work);
> +	cancel_work_sync(&session->unblock_work);
>   	/*
>   	 * If we are blocked let commands flow again. The lld or iscsi
>   	 * layer should set up the queuecommand to fail commands.

Reviewed-by: Lee Duncan <lduncan@suse.com>


  reply	other threads:[~2022-02-28 16:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 23:04 [PATCH 0/6] iscsi: Speed up failover with lots of devices Mike Christie
2022-02-26 23:04 ` [PATCH 1/6] scsi: iscsi: Fix recovery and ublocking race Mike Christie
2022-02-27 19:49   ` Lee Duncan
2022-02-28 20:06   ` Chris Leech
2022-02-26 23:04 ` [PATCH 2/6] scsi: iscsi: Speed up session unblocking and removal Mike Christie
2022-02-28 16:05   ` Lee Duncan [this message]
2022-02-28 20:06   ` Chris Leech
2022-02-26 23:04 ` [PATCH 3/6] scsi: iscsi: Remove iscsi_scan_finished Mike Christie
2022-02-28 18:05   ` Lee Duncan
2022-02-28 20:39     ` Mike Christie
2022-02-28 20:07   ` Chris Leech
2022-02-26 23:04 ` [PATCH 4/6] scsi: iscsi, ql4: Use per session workqueue for unbinding Mike Christie
2022-02-28 18:19   ` Lee Duncan
2022-02-28 20:07   ` Chris Leech
2022-02-26 23:04 ` [PATCH 5/6] scsi: iscsi: Use the session workqueue for recovery Mike Christie
2022-02-28 20:08   ` Chris Leech
2022-02-28 20:09   ` Lee Duncan
2022-02-26 23:04 ` [PATCH 6/6] scsi: iscsi: Drop temp workq_name Mike Christie
2022-02-28 20:08   ` Chris Leech
2022-02-28 22:49   ` Lee Duncan
2022-02-28 15:53 ` [PATCH 0/6] iscsi: Speed up failover with lots of devices Mike Christie
2022-03-02  4:20 ` Martin K. Petersen
2022-03-09  4:14 ` Martin K. Petersen

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=d7a2c1d3-ea5c-5da3-e656-017390af015f@suse.com \
    --to=lduncan@suse.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=cleech@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=liuzhengyuang521@gmail.com \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=mrangankar@marvell.com \
    --cc=njavali@marvell.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