[PATCH v1 2/3] scsi: ufs: Optimize host lock on transfer requests send/compl paths
cang at codeaurora.org
Tue Jun 1 19:14:39 PDT 2021
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
>> ufshcd_send_command() is also protected by host lock, when IRQ
>> fires, not only the CPU running the IRQ handler cannot send new
>> the rest CPUs can neither. Move the host lock wrapping the IRQ
>> handler into
>> specific branches, i.e., ufshcd_uic_cmd_compl(),
>> ufshcd_tmc_handler() and ufshcd_transfer_req_compl(). Meanwhile, to
>> 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
>> Cc: Stanley Chu <stanley.chu at mediatek.com>
>> Co-developed-by: Asutosh Das <asutoshd at codeaurora.org>
>> Signed-off-by: Asutosh Das <asutoshd at codeaurora.org>
>> Signed-off-by: Can Guo <cang at codeaurora.org>
> 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:
> I don't know if your patch can fix this
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 :).
> Reviewed-by: Bean Huo <beanhuo at micron.com>
More information about the Linux-mediatek