From: Bean Huo <huobean@gmail.com>
To: Bart Van Assche <bvanassche@acm.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
Peter Wang <peter.wang@mediatek.com>,
Avri Altman <avri.altman@sandisk.com>,
Bean Huo <beanhuo@micron.com>,
Manivannan Sadhasivam <mani@kernel.org>,
"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH] ufs: core: Improve IOPS
Date: Thu, 14 Aug 2025 11:02:17 +0200 [thread overview]
Message-ID: <2aad6f5c443501e72c776ce96f4aadaa10ed3889.camel@gmail.com> (raw)
In-Reply-To: <20250813171049.3399387-1-bvanassche@acm.org>
On Wed, 2025-08-13 at 10:10 -0700, Bart Van Assche wrote:
> Measurements have shown that IOPS improve by 2% - 3% on my UFS 4 test
> setup every time a ktime_get() call is removed from the UFS driver
> command processing path. Hence this patch that modifies
> ufshcd_clk_scaling_start_busy() such that ktime_get() is only called
> if the returned value will be used.
>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/ufs/core/ufshcd.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index b20f262fc8e4..9579e2481062 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -2231,11 +2231,13 @@ static void ufshcd_exit_clk_gating(struct ufs_hba *hba)
> static void ufshcd_clk_scaling_start_busy(struct ufs_hba *hba)
> {
> bool queue_resume_work = false;
> - ktime_t curr_t = ktime_get();
> + ktime_t curr_t;
>
> if (!ufshcd_is_clkscaling_supported(hba))
> return;
>
> + curr_t = ktime_get();
> +
> guard(spinlock_irqsave)(&hba->clk_scaling.lock);
>
> if (!hba->clk_scaling.active_reqs++)
>
Nice!
Reviewed-by: Bean Huo <beanhuo@micron.com>
next prev parent reply other threads:[~2025-08-14 9:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 17:10 [PATCH] ufs: core: Improve IOPS Bart Van Assche
2025-08-14 8:28 ` Peter Wang (王信友)
2025-08-14 15:48 ` Bart Van Assche
2025-08-15 6:21 ` Peter Wang (王信友)
2025-08-14 9:02 ` Bean Huo [this message]
2025-08-19 2:00 ` Martin K. Petersen
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=2aad6f5c443501e72c776ce96f4aadaa10ed3889.camel@gmail.com \
--to=huobean@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=adrian.hunter@intel.com \
--cc=avri.altman@sandisk.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=peter.wang@mediatek.com \
--cc=quic_nguyenb@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