Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4493834rwb; Mon, 21 Nov 2022 08:13:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf6c1l62ljZkSp5qIdmr1cKsn6v2hPObV5++whexPXN+K2tqX+GHn0ESnceHCFMtdUU6V9Fk X-Received: by 2002:a05:6402:1f87:b0:468:7df:c38c with SMTP id c7-20020a0564021f8700b0046807dfc38cmr16998780edc.150.1669047186988; Mon, 21 Nov 2022 08:13:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669047186; cv=none; d=google.com; s=arc-20160816; b=t2RGXtkXEQnn6bUvB8eo7GldCMbwLLwctcaQZjEl9wNKusHZ9AqMFXLjvhmYkjJ61X 1ufskb+tCFlv0CtjVEpztSX72a7kf0/ENYQHuZk5RaNf0nHFe8qY8XJj2d00lUPrUjcn yNZGPXb8vrjDNhFj13uV3/IBzaeZhu/gvkAqgnsDzfNLdWtvOB09r1ND6fJVwn5AHl3X Y/PaV5oi8fmCJm8i898WOfVQYV4LfBbtScE9ydt3vdQxFwC38KwEOMrcCppS1PgljUdD jSvKXKorCxKjJWAjHVnNNpR8e/RAfa4oDNylPn+0ImbJVW47SLiL/GXNFiEFfpUMep1O y9DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=IsyVkkqcMcpIPes0r7o8IwKY+V5C+oCJB4m8WUJ1tiU=; b=ZAx6OWG/q5Smk4Q9wEzqJInUxz0cNMiaRS61nnhjy8+jO42jBEBJFO5RI0qTRg6UBf PNTdKy4yuQDwffgMqqY++K+iTK9NoLXfDN8U470kr7z6OqElTNkjgUK6CrskxIWjWwlu q1YlCUjmg/43bZjLQ4G0h0fjp3JadGKLZJ6RjjwZeEHgzskCqOb4vQLWJmKJ/wln+RXO N8X4hvfR4CRF32IWGmue/msadV+suRRsvjgIuJ47GxaiC2ioEW567EN3Uhs0aOSFRWNO bljy+lzugBzNk3qeEX9qBoAgr9X6UA7a1cEU5D2HdvN2F5oGCb+AA14eA5ntpIdMyyBe +ICw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a16-20020aa7cf10000000b00459563e2c60si4119669edy.329.2022.11.21.08.12.40; Mon, 21 Nov 2022 08:13:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231864AbiKUOk2 (ORCPT + 91 others); Mon, 21 Nov 2022 09:40:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231690AbiKUOiN (ORCPT ); Mon, 21 Nov 2022 09:38:13 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42CF1AEBD8; Mon, 21 Nov 2022 06:38:12 -0800 (PST) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NG9355XMGzmVn8; Mon, 21 Nov 2022 22:37:37 +0800 (CST) Received: from dggpemm500017.china.huawei.com (7.185.36.178) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 22:38:06 +0800 Received: from [10.174.178.220] (10.174.178.220) by dggpemm500017.china.huawei.com (7.185.36.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 22:38:06 +0800 Message-ID: <3c7d52c7-6839-241e-c25e-05492bfdf115@huawei.com> Date: Mon, 21 Nov 2022 22:38:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v2 0/2] Fix scsi device's iodone_cnt mismatch with iorequest_cnt Content-Language: en-US To: "Martin K . Petersen" , , CC: Steffen Maier References: <20221021235638.1968832-1-haowenchao@huawei.com> From: Wenchao Hao In-Reply-To: <20221021235638.1968832-1-haowenchao@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.220] X-ClientProxiedBy: dggpeml500014.china.huawei.com (7.185.36.63) To dggpemm500017.china.huawei.com (7.185.36.178) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?