From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 515A6EB8FB6 for ; Wed, 6 Sep 2023 12:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbjIFMMT (ORCPT ); Wed, 6 Sep 2023 08:12:19 -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 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