linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Hao <haowenchao@huawei.com>
To: "Martin K . Petersen" <martin.petersen@oracle.com>,
	<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Steffen Maier <maier@linux.ibm.com>
Subject: Re: [PATCH v2 0/2] Fix scsi device's iodone_cnt mismatch with iorequest_cnt
Date: Mon, 21 Nov 2022 22:38:05 +0800	[thread overview]
Message-ID: <3c7d52c7-6839-241e-c25e-05492bfdf115@huawei.com> (raw)
In-Reply-To: <20221021235638.1968832-1-haowenchao@huawei.com>

On 2022/10/22 7:56, Wenchao Hao wrote:
> Following scenario would make scsi_device's iodone_cnt mismatch with
> iorequest_cnt even if there is no request on this device any more.
> 
> 1. request timeout happened. If we do not retry the timeouted command,
>    this command would be finished in scsi_finish_command() which would
>    not increase the iodone_cnt; if the timeouted command is retried,
>    another increasement for iorequest_cnt would be performed, the
>    command might add iorequest_cnt for multiple times but iodone_cnt
>    only once. Increase iodone_cnt in scsi_timeout() can handle this
>    scenario.
> 
> 2. scsi_dispatch_cmd() failed, while the iorequest_cnt has already been
>    increased. If scsi_dispatch_cmd() failed, the request would be
>    requeued, then another iorequest_cnt would be added. So we should not
>    increase iorequest_cnt if dispatch command failed
> 
> V2:
> - Add description about why we can add iodone_cnt in scsi_timeout()
> - Do not increase iorequest_cnt if dispatch command failed
> 
> Wenchao Hao (2):
>   scsi: increase scsi device's iodone_cnt in scsi_timeout()
>   scsi: donot increase scsi_device's iorequest_cnt if dispatch failed
> 
>  drivers/scsi/scsi_error.c | 1 +
>  drivers/scsi/scsi_lib.c   | 3 +--
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 

Hi Martin, these two count is useful for us, would like take a look?


      parent reply	other threads:[~2022-11-21 14:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 23:56 [PATCH v2 0/2] Fix scsi device's iodone_cnt mismatch with iorequest_cnt Wenchao Hao
2022-10-21 23:56 ` [PATCH v2 1/2] scsi: increase scsi device's iodone_cnt in scsi_timeout() Wenchao Hao
2022-11-22 16:25   ` Mike Christie
2022-10-21 23:56 ` [PATCH v2 2/2] scsi: donot increase scsi_device's iorequest_cnt if dispatch failed Wenchao Hao
2022-11-22 16:32   ` Mike Christie
2022-11-08  3:08 ` [PATCH v2 0/2] Fix scsi device's iodone_cnt mismatch with iorequest_cnt Wenchao Hao
2022-11-21 14:38 ` Wenchao Hao [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=3c7d52c7-6839-241e-c25e-05492bfdf115@huawei.com \
    --to=haowenchao@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=maier@linux.ibm.com \
    --cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).