From: Bart Van Assche <bvanassche@acm.org>
To: Ziqi Chen <quic_ziqichen@quicinc.com>
Cc: linux-scsi@vger.kernel.org, Can Guo <quic_cang@quicinc.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
Peter Wang <peter.wang@mediatek.com>,
Avri Altman <avri.altman@sandisk.com>,
Manivannan Sadhasivam <mani@kernel.org>,
"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
Stanley Jhu <chu.stanley@gmail.com>,
Asutosh Das <quic_asutoshd@quicinc.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH] scsi: ufs: Make ufshcd_clock_scaling_prepare() compatible with MCQ
Date: Mon, 7 Jul 2025 12:40:22 -0700 [thread overview]
Message-ID: <7dc658a7-5951-48ea-bf3f-9264f0383f19@acm.org> (raw)
In-Reply-To: <f8c6ea60-7e39-483e-b850-e658eb8fb13c@quicinc.com>
On 7/3/25 1:29 AM, Ziqi Chen wrote:
> Although patch functional is OK, but I found this patch will increase
> the latency of ufshcd_clock_scaling_prepare():
>
> MTP 8550 (upstream kernel):
> Original:
> spent: 226302 ns, avg: 2135214 ns, count: 200, total:427042923 ns
> with patch:
> spent: 1213333 ns, avg: 4583551 ns, count: 200, total:916710316 ns
>
> MTP 8650 (upstream kernel):
> Original:
> spent: 2013386 ns, avg: 1464596 ns, count: 150, total:219689530 ns
> with patch:
> spent: 2718802 ns, avg: 4329696 ns, count: 150, total:649454539 ns
>
> MTP8850 (downstream kernel)
> Original:
> spent: 144323 ns, avg: 1080332 ns, count: 2005, total:2166066242 ns
> with patch:
> spent: 2530208 ns, avg: 1307159 ns, count: 2005, total:2620855033 ns
That's unfortunate ...
> I think this increament is come from you replaced blk_mq_quiesce_queue()
> with blk_freeze_queue(), as my understading , the blk_mq_quiesce_queue()
> just only block new IO be dispatched to hardware queue but the
> blk_freeze_queue() will freeze whole queue and wait all IOs get
> complete.
Hmm ... both blk_freeze_queue() and the loop that calls
ufshcd_pending_cmds() should wait for all pending commands to finish. So
the latency increase probably comes from the synchronize_rcu_expedited()
call.
> I am not understand you said "ufshcd_wait_for_doorbell_clr() supports
> the legacy doorbell mode but not MCQ". In ufshcd_wait_for_doorbell_clr()
> , tr_pending = ufshcd_pending_cmds(hba) is counted from budget_map, not
> read from legacy doorbell, it is used to get inflight cmds for MCQ mode.
That was a misunderstanding from my side. Since the current code already
supports MCQ and my patch doesn't improve the clock scaling latency,
let's drop this patch.
Thanks,
Bart.
next prev parent reply other threads:[~2025-07-07 19:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 20:12 [PATCH] scsi: ufs: Make ufshcd_clock_scaling_prepare() compatible with MCQ Bart Van Assche
2025-06-30 20:19 ` Bart Van Assche
2025-07-01 4:04 ` Ziqi Chen
2025-07-03 8:29 ` Ziqi Chen
2025-07-07 19:40 ` Bart Van Assche [this message]
2025-07-04 12:04 ` Peter Wang (王信友)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7dc658a7-5951-48ea-bf3f-9264f0383f19@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=avri.altman@sandisk.com \
--cc=chu.stanley@gmail.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=peter.wang@mediatek.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=quic_ziqichen@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox