* [PATCH] PM/QoS: resume latency 0 should be not latency allowed
@ 2021-11-01 11:36 Youquan Song
2021-11-05 15:50 ` Rafael J. Wysocki
0 siblings, 1 reply; 5+ messages in thread
From: Youquan Song @ 2021-11-01 11:36 UTC (permalink / raw)
To: linux-pm, rafael.j.wysocki; +Cc: youquan.song
ICX and more recent Intel CPU has C1 exit_latency equal 1 in intel_idle
driver, There are PM QoS interfaces: global /dev/cpu_dma_latency and
per-device latency constraints. per-CPU set pm_qos_resume_latency_us
to limit single CPU entery into deepest C-state.
When it is required to disable entry into even C1, we need to set "0"
to /sys pm_qos_resume_latency_us, but "0" of pm_qos_resume_latency_us
is redefined to no constraint now.
so this patch set "0" back to original meaning "no latency at all".
Signed-off-by: Youquan Song <youquan.song@intel.com>
---
drivers/base/power/sysfs.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
index a1474fb67db9..b4bd67e6f440 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
@@ -214,10 +214,8 @@ static ssize_t pm_qos_resume_latency_us_show(struct device *dev,
{
s32 value = dev_pm_qos_requested_resume_latency(dev);
- if (value == 0)
- return sysfs_emit(buf, "n/a\n");
if (value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
- value = 0;
+ return sysfs_emit(buf, "no constraint\n");
return sysfs_emit(buf, "%d\n", value);
}
@@ -237,10 +235,8 @@ static ssize_t pm_qos_resume_latency_us_store(struct device *dev,
if (value < 0 || value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
return -EINVAL;
- if (value == 0)
- value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
} else if (sysfs_streq(buf, "n/a")) {
- value = 0;
+ value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
} else {
return -EINVAL;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] PM/QoS: resume latency 0 should be not latency allowed
2021-11-01 11:36 [PATCH] PM/QoS: resume latency 0 should be not latency allowed Youquan Song
@ 2021-11-05 15:50 ` Rafael J. Wysocki
[not found] ` <BYAPR11MB3205164D85635F784AFA4C429C939@BYAPR11MB3205.namprd11.prod.outlook.com>
0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2021-11-05 15:50 UTC (permalink / raw)
To: Youquan Song; +Cc: Linux PM, Rafael Wysocki
On Mon, Nov 1, 2021 at 1:50 PM Youquan Song <youquan.song@intel.com> wrote:
>
> ICX and more recent Intel CPU has C1 exit_latency equal 1 in intel_idle
Please expand "ICX".
> driver, There are PM QoS interfaces: global /dev/cpu_dma_latency and
> per-device latency constraints. per-CPU set pm_qos_resume_latency_us
> to limit single CPU entery into deepest C-state.
> When it is required to disable entry into even C1, we need to set "0"
> to /sys pm_qos_resume_latency_us, but "0" of pm_qos_resume_latency_us
> is redefined to no constraint now.
>
> so this patch set "0" back to original meaning "no latency at all".
It is not "back", it simply changes the meaning of 0. And that's why
Documentation/ABI/testing/sysfs-devices-power needs to be updated.
> Signed-off-by: Youquan Song <youquan.song@intel.com>
> ---
> drivers/base/power/sysfs.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
> index a1474fb67db9..b4bd67e6f440 100644
> --- a/drivers/base/power/sysfs.c
> +++ b/drivers/base/power/sysfs.c
> @@ -214,10 +214,8 @@ static ssize_t pm_qos_resume_latency_us_show(struct device *dev,
> {
> s32 value = dev_pm_qos_requested_resume_latency(dev);
>
> - if (value == 0)
> - return sysfs_emit(buf, "n/a\n");
> if (value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
> - value = 0;
> + return sysfs_emit(buf, "no constraint\n");
>
> return sysfs_emit(buf, "%d\n", value);
> }
> @@ -237,10 +235,8 @@ static ssize_t pm_qos_resume_latency_us_store(struct device *dev,
> if (value < 0 || value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
> return -EINVAL;
>
> - if (value == 0)
> - value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
> } else if (sysfs_streq(buf, "n/a")) {
> - value = 0;
> + value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
> } else {
> return -EINVAL;
> }
> --
But do you really need to make these changes? What problem is there
with using the interface as currently documented, ie. writing "n/a" to
it to get "no latency at all"?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-11-11 17:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 11:36 [PATCH] PM/QoS: resume latency 0 should be not latency allowed Youquan Song
2021-11-05 15:50 ` Rafael J. Wysocki
[not found] ` <BYAPR11MB3205164D85635F784AFA4C429C939@BYAPR11MB3205.namprd11.prod.outlook.com>
[not found] ` <20211110105833.GA30301@linux-youquan.bj.intel.com>
2021-11-10 19:24 ` Rafael J. Wysocki
2021-11-11 4:28 ` Youquan Song
2021-11-11 17:07 ` Rafael J. Wysocki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.