Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2676293rdb; Wed, 6 Sep 2023 11:20:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIIAF29Gouho/XPEjIaP/VJr/4HfF/Z9f/yW154XGDUOa4QXuUhoh5AVboQ2otuBDXXWW8 X-Received: by 2002:a05:6512:2399:b0:4fd:f84f:83c1 with SMTP id c25-20020a056512239900b004fdf84f83c1mr3409046lfv.64.1694024410005; Wed, 06 Sep 2023 11:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694024409; cv=none; d=google.com; s=arc-20160816; b=p4KXY4WdJlpcEWPJhcIZvM6+qR+22oRrCUhMUuMtC2aazGL7sN84wcAVfxgysx4z3W bjUxSdXs4/tKUGJqLapIiad2wjPTjhpnfh6bY8rUROncnA1G57YjG3gtQcF7SfZdeXni oBZ178YGIAOBaiJuRM5naSDj1J1Z3LvZLUEDsMoswcIasQgV4SFZEwWNPXH2s1QxYSQi OKSLlClo1SzH+g6a2Z1gfuDKBZB1RPi9JEdTqvU1e6D2MycYNrz/HTa27HxxXN4xBE1m GveplbT7vj5TUfh9MvEKhENSAQfHnX6EOabavW1FqzUFVYTcDWzw2tYL9x7wauF3y45r nPtg== 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=R308b9LtgPC/nViFfhdrbGAJHYGpaeQau3oiL17dO6k=; fh=yty4708ccV2rI87hXikAXbZx+8Dc1dfphCt2FX0Uegw=; b=uGWE/qtjzC4iA5BPwSEoggfH9bGie+PqI59B8Ox03qCGNpkm+0dS7JA1O00wsAqKjc 7IIUBY+Ey30eTNDbQTLdS03GMdporrb0I8/0awN6uObEU5wYcC0cPzkdvsruNO/NRCAY Al1xBHwxQbQNAFuPSlDiuJZl/qOpW5Gsd4CI+Fxe49ZLvX2DJLaUEBSgZPZxk8RLxz6n r4fOpMHGJLcylXlTwpEcmASrpQnBYX+3IFyPHqabcFM+CIzdaIe48n2NNRgGmZG0ONqW mcXvD70cIb75xU+WneQeSux5txCa8DLIzYplzUQueQAMQLSa+olAphxZPHBtd3fSPzue aiSw== 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 b11-20020aa7cd0b000000b0052596c88933si9730604edw.129.2023.09.06.11.19.41; Wed, 06 Sep 2023 11:20:09 -0700 (PDT) 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 S240512AbjIFMMS (ORCPT + 99 others); Wed, 6 Sep 2023 08:12:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236607AbjIFMMR (ORCPT ); Wed, 6 Sep 2023 08:12:17 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CCA71709; Wed, 6 Sep 2023 05:12:13 -0700 (PDT) Received: from kwepemm600012.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rgh3d6BBVzNmmH; Wed, 6 Sep 2023 20:08:29 +0800 (CST) Received: from [10.174.178.220] (10.174.178.220) by kwepemm600012.china.huawei.com (7.193.23.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 6 Sep 2023 20:12:09 +0800 Message-ID: Date: Wed, 6 Sep 2023 20:12:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [RFC PATCH v2 09/19] scsi: core: increase/decrease target_busy without check can_queue Content-Language: en-US To: Mike Christie , "James E . J . Bottomley" , "Martin K . Petersen" , CC: Hannes Reinecke , , , References: <20230901094127.2010873-1-haowenchao2@huawei.com> <20230901094127.2010873-10-haowenchao2@huawei.com> From: Wenchao Hao In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.220] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600012.china.huawei.com (7.193.23.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 2023/9/6 7:55, Mike Christie wrote: > On 9/1/23 4:41 AM, Wenchao Hao wrote: >> This is preparation for a genernal target based error handle strategy >> to check if to wake up actual error handler. >> >> Signed-off-by: Wenchao Hao >> --- >> drivers/scsi/scsi_lib.c | 11 ++++------- >> 1 file changed, 4 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >> index db0a42fe49c0..4a7fb48aa60f 100644 >> --- a/drivers/scsi/scsi_lib.c >> +++ b/drivers/scsi/scsi_lib.c >> @@ -293,8 +293,7 @@ void scsi_device_unbusy(struct scsi_device *sdev, struct scsi_cmnd *cmd) >> >> scsi_dec_host_busy(shost, cmd); >> >> - if (starget->can_queue > 0) >> - atomic_dec(&starget->target_busy); >> + atomic_dec(&starget->target_busy); >> > > Ming had found that removing the atomics improves perf. > Since most drivers didn't care about the target level counters > it was moved to the can_queue check so only drivers using the > feature suffer the perf hit. > > Your patch should do the same. > Would update in next version