mbox series

[V6,0/2] Add CPU latency QoS support for ufs driver

Message ID 20231219123706.6463-1-quic_mnaresh@quicinc.com
Headers show
Series Add CPU latency QoS support for ufs driver | expand

Message

Naresh Maramaina Dec. 19, 2023, 12:37 p.m. UTC
Add CPU latency QoS support for ufs driver. This improves random io
performance by 15% for ufs.

tiotest benchmark tool io performance results on sm8550 platform:

1. Without PM QoS support
	Type (Speed in)    | Average of 18 iterations
	Random Read(IPOS)  | 37101.3
	Random Write(IPOS) | 41065.13

2. With PM QoS support
	Type (Speed in)    | Average of 18 iterations
	Random Read(IPOS)  | 42943.4
	Random Write(IPOS) | 46784.9
(Improvement with PM QoS = ~15%).

This patch is based on below patch by Stanley Chu [1]. 
Moving the PM QoS code to ufshcd.c and making it generic.

[1] https://lore.kernel.org/r/20220623035052.18802-8-stanley.chu@mediatek.com

Changes from v5:
- Addressed bvanassche comment to use kstrtobool instead kstrtou32
- Addressed bvanassche comment to add sys attribute into an existing group

Changes from v4:
- Addressed angelogioacchino's comment to update commit text
- Addressed angelogioacchino's comment to code alignment

Changes from v3:
- Removed UFSHCD_CAP_PM_QOS capability flag from patch#2

Changes from v2:
- Addressed bvanassche and mani comments
- Provided sysfs interface to enable/disable PM QoS feature

Changes from v1:
- Addressed bvanassche comments to have the code in core ufshcd
- Design is changed from per-device PM QoS to CPU latency QoS based support
- Reverted existing PM QoS feature from MEDIATEK UFS driver
- Added PM QoS capability for both QCOM and MEDIATEK SoCs

Maramaina Naresh (2):
  ufs: core: Add CPU latency QoS support for ufs driver
  ufs: ufs-mediatek: Migrate to UFSHCD generic CPU latency PM QoS
    support

 drivers/ufs/core/ufs-sysfs.c    | 49 ++++++++++++++++++++++++++++++++
 drivers/ufs/core/ufshcd.c       | 50 +++++++++++++++++++++++++++++++++
 drivers/ufs/host/ufs-mediatek.c | 17 -----------
 drivers/ufs/host/ufs-mediatek.h |  3 --
 include/ufs/ufshcd.h            |  6 ++++
 5 files changed, 105 insertions(+), 20 deletions(-)

Comments

Martin K. Petersen Jan. 24, 2024, 2 a.m. UTC | #1
Maramaina,

> Add CPU latency QoS support for ufs driver. This improves random io
> performance by 15% for ufs.

Applied to 6.9/scsi-staging, thanks!
Martin K. Petersen Jan. 30, 2024, 2:27 a.m. UTC | #2
On Tue, 19 Dec 2023 18:07:04 +0530, Maramaina Naresh wrote:

> Add CPU latency QoS support for ufs driver. This improves random io
> performance by 15% for ufs.
> 
> tiotest benchmark tool io performance results on sm8550 platform:
> 
> 1. Without PM QoS support
> 	Type (Speed in)    | Average of 18 iterations
> 	Random Read(IPOS)  | 37101.3
> 	Random Write(IPOS) | 41065.13
> 
> [...]

Applied to 6.9/scsi-queue, thanks!

[1/2] ufs: core: Add CPU latency QoS support for ufs driver
      https://git.kernel.org/mkp/scsi/c/2777e73fc154
[2/2] ufs: ufs-mediatek: Migrate to UFSHCD generic CPU latency PM QoS support
      https://git.kernel.org/mkp/scsi/c/0652205b4ce2