Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp200744pxj; Tue, 1 Jun 2021 19:16:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuQrwyIhdLujN5rSgfn9tI507AxkDbBGKmAxwc5brxPommt2lgKHtHbKXSvACj+vCfNKC6 X-Received: by 2002:a02:c04c:: with SMTP id u12mr27971053jam.129.1622600214976; Tue, 01 Jun 2021 19:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622600214; cv=none; d=google.com; s=arc-20160816; b=PGZlNnd5BlTSAmwAvHF8VNe/YoSlv9gcxygKToiNV13ZuewugZzS/3ctjmSr6+zKwV sKEwLT7qBMIIDUo2G7d5f6afotYCPyGqDOWer46HjqaYt73lRPEsKOPO1kFqQMjavWDK Otk4I7LHf4KVvK6XNO2PNUVTbaGx3U6zhZAZav8WUvC1a3zGW0riqy4XzKxoedD/m6Bc 5Wsk+zI1iLIb3yRAhSn8kaTOetdcpv82TzCBA/aeQiW7DQBNy3f2wqua/Az/ftnpgU4R O8aTjUwJLemqgou6vC7/t5Ph7FNQ3Q8Vg5oPFG36qhoQRchNMSJQ2ZYfLhpH0XJgBlXT ndmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=iOQwgqabrc1MbfT07CPHtQODLtRaNjncaWi9mJJSGlQ=; b=J/xZKZGJ0mWkWzQ32L+8/m7LLktauV1bRfKPLfVixoeZym29TP1dEgFryeeKCio/+G qm38vktnaBR1qToXGvJgkx+C2xjvMoFrCKT01Rr3TR/VUkkcJ5BO23oAnL8i72bXU4Gm 68fMTFlL55xop3so0VF259cxgOWOwHaTA8jbxYD2oTZ0uFVk5WeQ7w7bDzek8nFsBiuy HvjGCZIcsZLYNKVIvELbMEymBsCEK7fPdXZRCJkhGEJoI6uiCmyTl/iRECCWZgfNAxvM 0m0wJEO+7CZAy8wANxPqIOXFeZTGnbslOH09qyNj/v0rag/cBLh4HUQlZuNn6HBhrWUB eRyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=G7TqxZz7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o1si21120248jat.48.2021.06.01.19.16.41; Tue, 01 Jun 2021 19:16:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=G7TqxZz7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229967AbhFBCQh (ORCPT + 99 others); Tue, 1 Jun 2021 22:16:37 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:17230 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbhFBCQg (ORCPT ); Tue, 1 Jun 2021 22:16:36 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1622600094; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=iOQwgqabrc1MbfT07CPHtQODLtRaNjncaWi9mJJSGlQ=; b=G7TqxZz7NYfTW6FC5UCMgRIzR5h498GWyxDz8HNcBPxpOjOzJ/Lg8Cs78OvciSqsbKj5iNzC mvIgshlhUVCF3OTDFgWp0f1rsXcITXgx78VJe6+Rg9P9j0uNK/O95hbvvvKXfHtP57mdiXl3 aybqmVvwBshKjWf6d1umLVajhzA= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 60b6e993f726fa4188928ac5 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Jun 2021 02:14:43 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 1EC6BC4338A; Wed, 2 Jun 2021 02:14:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id 61B2DC433F1; Wed, 2 Jun 2021 02:14:39 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 02 Jun 2021 10:14:39 +0800 From: Can Guo To: Bean Huo Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, Stanley Chu , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger , Bean Huo , Jaegeuk Kim , Adrian Hunter , Kiwoong Kim , Satya Tangirala , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH v1 2/3] scsi: ufs: Optimize host lock on transfer requests send/compl paths In-Reply-To: <6d6d296a84f1e62f65fda4d172a85bb35d9a3684.camel@gmail.com> References: <1621845419-14194-1-git-send-email-cang@codeaurora.org> <1621845419-14194-3-git-send-email-cang@codeaurora.org> <6d6d296a84f1e62f65fda4d172a85bb35d9a3684.camel@gmail.com> Message-ID: X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bean, On 2021-06-01 00:04, Bean Huo wrote: > On Mon, 2021-05-24 at 01:36 -0700, Can Guo wrote: >> Current UFS IRQ handler is completely wrapped by host lock, and >> because >> >> ufshcd_send_command() is also protected by host lock, when IRQ >> handler >> >> fires, not only the CPU running the IRQ handler cannot send new >> requests, >> >> the rest CPUs can neither. Move the host lock wrapping the IRQ >> handler into >> >> specific branches, i.e., ufshcd_uic_cmd_compl(), >> ufshcd_check_errors(), >> >> ufshcd_tmc_handler() and ufshcd_transfer_req_compl(). Meanwhile, to >> further >> >> reduce occpuation of host lock in ufshcd_transfer_req_compl(), host >> lock is >> >> no longer required to call __ufshcd_transfer_req_compl(). As per >> test, the >> >> optimization can bring considerable gain to random read/write >> performance. >> >> >> >> Cc: Stanley Chu >> >> Co-developed-by: Asutosh Das >> >> Signed-off-by: Asutosh Das >> >> Signed-off-by: Can Guo > > Can, > The patch looks good to me. > I did a UFS queue limitation test before, observed that once the queue > is full, then the active task number in the queue will get down. For > the Nvme, the scenario is the same. You can refer to the slide 23, and > slide 24 in the pdf: > https://elinux.org/images/6/6c/Linux_Storage_System_Bottleneck_Exploration_V0.3.pdf > I don't know if your patch can fix this > issue. I've studied these slides made by you many times, it is really good. I will do some study later on this. Thanks for the slides. > > Unfortunately, I cannot verify UTRLCNR usage flow since my platform is > v2.1. But at least my test can prove that the patch doesn't impact the > legacy(UFSHCI is less than v3.0) doorbell usage flow. > Thanks for your time :). Regards, Can Guo. > Reviewed-by: Bean Huo > > > Bean