Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1044808pxb; Wed, 6 Apr 2022 07:25:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN+OWIWcUcMN0Oufv9WZf0GtSfnY/kPtCM952X+5MRfLwSTTseJgH/aCU7ZWCGLZ3MIZaW X-Received: by 2002:a63:2a92:0:b0:398:a420:4faa with SMTP id q140-20020a632a92000000b00398a4204faamr7317734pgq.222.1649255125871; Wed, 06 Apr 2022 07:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649255125; cv=none; d=google.com; s=arc-20160816; b=Zq5wrPKBFpNOAhwuupYfMMt18CW+OVtZKkvIcTnjpVsubuy2shaIxEVF7UU1uqa/Z4 CtOFm4eZIZxSAU3EWhqYgzUUSCp4wc9bEWrPl7EhCx4FjzHEVO0NDky4hv1QW0WHHBX8 XgztWrZwU6Gec6d7ejGfWICTokD1ICZ2gNZSMaQXLzBYh3YmsEE3v9z1o+Ero5D+8F/8 xh0kRkRK/4tA2CfD6ki/Wa074BP8iKhUMVi6OttJa+UbHTEH1mHoUNDsAtK+zZ6phirf n4ajQJLx6sk/9MiDA2/AEb6eudNl1jYbF9sM0Xb+fAbi6HPP1T6t2VRM1MCuzk0wxsvj vOJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from; bh=lVexGUWVh+Vq8N30R1X7vu7lkS7OV0FA/RJR0F9rq8w=; b=W8FbOKbLg1ywF65sSKACnCuXn6PL8UXtZ22a72YcS3eKtWku8NHPnpfKykCHjs7ATv ipKeOe5r4QegMXEF7OSnEAPh9ecvCjoUfQHbw9VTlceHwEFpY0t/ef8+o+nAfLCY9vfh RzLQz2B5qDzLOWk7arA4CbydYoc9OSHG/msHjrt5feecmmjyKZLyRcklWhATolurwDsU b+pa62mZ1Xaut2bWewpa91WdVctWa5HirHYASjnMj5AgVKAusCgG6+4LVSAz2VS+yKY2 nTUfYpiBFJFqqb+Cx7VHDldwLRADPAPceRAuSqGswZueM6RgYXkI32CrPJUYLmAuIghl Z65A== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n7-20020a635c47000000b003816043ef09si13428029pgm.254.2022.04.06.07.25.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:25:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA6714F9627; Wed, 6 Apr 2022 05:09:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238765AbiDFKgT (ORCPT + 99 others); Wed, 6 Apr 2022 06:36:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236518AbiDFKfV (ORCPT ); Wed, 6 Apr 2022 06:35:21 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC14D4B47B9; Tue, 5 Apr 2022 23:56:34 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KYFcm6f5rzgYLw; Wed, 6 Apr 2022 14:54:48 +0800 (CST) Received: from dggpemm500017.china.huawei.com (7.185.36.178) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 6 Apr 2022 14:56:33 +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.2308.21; Wed, 6 Apr 2022 14:56:32 +0800 From: Wenchao Hao Subject: Re: [PATCH] scsi: core: always finish successfully aborted notry command To: Mike Christie , "James E . J . Bottomley" , "Martin K . Petersen" , Hannes Reinecke , , CC: References: <20220401035020.1043239-1-haowenchao@huawei.com> <775f75db-edb8-8f39-2592-862756811710@oracle.com> Message-ID: <275178ca-1fe4-b00b-c1f4-c8c34e7f4686@huawei.com> Date: Wed, 6 Apr 2022 14:56:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <775f75db-edb8-8f39-2592-862756811710@oracle.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.220] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500017.china.huawei.com (7.185.36.178) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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/4/4 0:58, Mike Christie wrote: > On 3/31/22 10:50 PM, Wenchao Hao wrote: >> If the abort command succeed and it does not need to be retired, do not add >> it to error handle list. >> >> Adding command to error handle list is an annoying flow which would stop I/O >> of all LUNs which shared a same HBA. >> >> So here if we successfully abort a command, we can finish it via >> scsi_finish_command() which would reduce time spent on scsi_error_handler() >> >> Signed-off-by: Wenchao Hao >> --- >> drivers/scsi/scsi_error.c | 55 +++++++++++++++++++++------------------ >> 1 file changed, 29 insertions(+), 26 deletions(-) >> >> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c >> index cdaca13ac1f1..15299603b7ee 100644 >> --- a/drivers/scsi/scsi_error.c >> +++ b/drivers/scsi/scsi_error.c >> @@ -173,41 +173,44 @@ scmd_eh_abort_handler(struct work_struct *work) >> goto out; >> } >> set_host_byte(scmd, DID_TIME_OUT); >> - if (scsi_host_eh_past_deadline(shost)) { >> - SCSI_LOG_ERROR_RECOVERY(3, >> - scmd_printk(KERN_INFO, scmd, >> - "eh timeout, not retrying " >> - "aborted command\n")); >> - goto out; >> - } >> >> - spin_lock_irqsave(shost->host_lock, flags); >> - list_del_init(&scmd->eh_entry); >> + if (scsi_noretry_cmd(scmd) || >> + !scsi_cmd_retry_allowed(scmd) && >> + !scsi_eh_should_retry_cmd(scmd)) { > > > I don't think this test is correct. Did you want all ||s? Sorry, I made a mistake, it should be "||" here. > > For what the patch is trying to accomplish I'm not sure if it's > the behavior people wanted. Do all drivers have configurable > abort timeouts? If an abort takes N minutes to complete ok, > and that's put us over the eh deadline maybe the user wanted > that device to be offlined. > . > I think the changes would not affect the timeouts and deadline because the logic changed is after command abort successfully. We check if the command need to be retired after aborting command successfully, if it does not need to retry, just finish it (only commands aborted failed should be add to error handle list). I submit this change because we want to reduce the time spent on scsi_error_handler(). Do you think the change is OK? Except previous wrong "&&" which should be "||". Thanks, looking forward to hearing from you.