Add per-cpu PM QoS support for ufs. This improves random io performance
by 20% for ufs.
tiotest benchmark tool io performance results on sm8550 platform:
1. Without PM QoS support
Type (Speed in) | Average of 6 iterations
Random Write(IPOS) | 32201
Random Read(IPOS) | 32201
2. With PM QoS support
Type (Speed in) | Average of 6 iterations
Random Write(IPOS) | 40833.5
Random Read(IPOS) | 40833.5
(Improvement % with PM QoS = ~20%).
Maramaina Naresh (4):
dt-bindings: ufs: qcom: Add qos property
ufs: ufs-qcom: Add per-cpu PM QoS support for ufs
ufs: ufs-qcom: Add per-cpu PM QoS vote support for ufs
arm64: dts: qcom: sm8550: Add per-cpu PM QoS support for ufs
.../devicetree/bindings/ufs/qcom,ufs.yaml | 16 +
arch/arm64/boot/dts/qcom/sm8550.dtsi | 9 +
drivers/ufs/host/ufs-qcom.c | 340 ++++++++++++++++++++-
drivers/ufs/host/ufs-qcom.h | 37 +++
4 files changed, 401 insertions(+), 1 deletion(-)
--
2.7.4
Qcom SoCs requires registering ufs driver to PM QoS for random io
performance improvement.
PM QoS initialization will parse all QoS CPU group device tree
entries, allocate memory for each individual PM QoS groups and
initiates DEV_PM_QOS_RESUME_LATENCY type of PM QoS request for
new dev_pm_qos_request handle for each CPU. Voting for maximum
latency S32_MAX during driver init.
tiotest benchmark tool io performance results on sm8550 platform:
1. Without PM QoS support
Type (Speed in) | Average of 6 iterations
Random Write(IPOS) | 32201
Random Read(IPOS) | 32201
2. With PM QoS support
Type (Speed in) | Average of 6 iterations
Random Write(IPOS) | 40833.5
Random Read(IPOS) | 40833.5
(Improvement % with PM QoS = ~20%).
Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Nitin Rawat <redacted>
Signed-off-by: Naveen Kumar Goud Arepalli <redacted>
Signed-off-by: Maramaina Naresh <redacted>
---
drivers/ufs/host/ufs-qcom.c | 152 ++++++++++++++++++++++++++++++++++++++++++++
drivers/ufs/host/ufs-qcom.h | 29 +++++++++
2 files changed, 181 insertions(+)
@@ -1,5 +1,6 @@/* SPDX-License-Identifier: GPL-2.0-only *//* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.+*Copyright(c)2023QualcommInnovationCenter,Inc.Allrightsreserved.*/#ifndef UFS_QCOM_H_
PM QoS per-cpu framework provides performance requirements for each cpu.
The per-cpu PM QoS framework will provide the corresponding interface to
collect the resume_latency request of the specified device and provide
it to the runtime PM. When suspending the device, it will consider this
requirement and decide whether to suspend the device.
Voting will follow below sequence.
1. Vote for maximum latency S32_MAX in driver init.
2. Schedule a vote of PERF when a transfer request is received.
3. Update the vote to S32_MAX during clock gating.
Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Nitin Rawat <redacted>
Signed-off-by: Naveen Kumar Goud Arepalli <redacted>
Signed-off-by: Maramaina Naresh <redacted>
---
drivers/ufs/host/ufs-qcom.c | 188 +++++++++++++++++++++++++++++++++++++++++++-
drivers/ufs/host/ufs-qcom.h | 8 ++
2 files changed, 195 insertions(+), 1 deletion(-)
@@ -76,6 +76,14 @@ properties:$ref:/schemas/types.yaml#/definitions/phandledescription:phandle to the Inline Crypto Engine node+qos:+minItems:2+maxItems:2+cpumask:+description:list of CPUs under CPU group+vote:+description:vote value for QoS CPU group+reg:minItems:1maxItems:2
From: Rob Herring <robh@kernel.org> Date: 2023-10-10 16:27:50
On Tue, 10 Oct 2023 21:19:04 +0530, Maramaina Naresh wrote:
Add bindings for per-cpu QoS for QCOM UFS. This improves random io
performance by 20% for QCOM UFS.
Signed-off-by: Maramaina Naresh <redacted>
---
Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
./Documentation/devicetree/bindings/ufs/qcom,ufs.yaml:83:6: [warning] wrong indentation: expected 6 but found 5 (indentation)
./Documentation/devicetree/bindings/ufs/qcom,ufs.yaml:85:6: [warning] wrong indentation: expected 6 but found 5 (indentation)
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml: properties:qos: 'anyOf' conditional failed, one must be fixed:
'cpumask' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
'type' was expected
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml: properties:qos: 'anyOf' conditional failed, one must be fixed:
'vote' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
'type' was expected
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/ufs/qcom,ufs.yaml: qos: missing type definition
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/ufs/qcom,ufs.example.dtb: ufs@1d84000: Unevaluated properties are not allowed ('qos0', 'qos1' were unexpected)
from schema $id: http://devicetree.org/schemas/ufs/qcom,ufs.yaml#
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/1696952947-18062-2-git-send-email-quic_mnaresh@quicinc.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
From: Konrad Dybcio <hidden> Date: 2023-10-10 16:41:46
On 10/10/23 17:49, Maramaina Naresh wrote:
PM QoS per-cpu framework provides performance requirements for each cpu.
The per-cpu PM QoS framework will provide the corresponding interface to
collect the resume_latency request of the specified device and provide
it to the runtime PM. When suspending the device, it will consider this
requirement and decide whether to suspend the device.
Voting will follow below sequence.
1. Vote for maximum latency S32_MAX in driver init.
2. Schedule a vote of PERF when a transfer request is received.
3. Update the vote to S32_MAX during clock gating.
Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Nitin Rawat <redacted>
Signed-off-by: Naveen Kumar Goud Arepalli <redacted>
Signed-off-by: Maramaina Naresh <redacted>
---
From: Bart Van Assche <bvanassche@acm.org> Date: 2023-10-11 20:56:55
On 10/10/23 08:49, Maramaina Naresh wrote:
Add per-cpu PM QoS support for ufs. This improves random io performance
by 20% for ufs.
What in this patch series (other than the DT-bindings) is specific to
the Qualcomm driver? If the answer is not much: please move this
functionality into the UFS driver core.
Thanks,
Bart.
Hi Bart,
Thank you for reviewing the patch. This is not specific to the Qualcomm driver.
We will move this feature to core UFS.
Thanks,
Naresh.
On 10/12/2023 2:26 AM, Bart Van Assche wrote:
On 10/10/23 08:49, Maramaina Naresh wrote:
quoted
Add per-cpu PM QoS support for ufs. This improves random io performance
by 20% for ufs.
What in this patch series (other than the DT-bindings) is specific to
the Qualcomm driver? If the answer is not much: please move this
functionality into the UFS driver core.
Thanks,
Bart.