All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Youquan Song <youquan.song@intel.com>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	Rafael Wysocki <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH] PM/QoS: resume latency 0 should be not latency allowed
Date: Fri, 5 Nov 2021 16:50:29 +0100	[thread overview]
Message-ID: <CAJZ5v0jJ+tthguYtq81EbapZAxLkUkz=B=quDWcMzHQFcWAnrA@mail.gmail.com> (raw)
In-Reply-To: <1635766618-24732-1-git-send-email-youquan.song@intel.com>

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"?

  reply	other threads:[~2021-11-05 15:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [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

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='CAJZ5v0jJ+tthguYtq81EbapZAxLkUkz=B=quDWcMzHQFcWAnrA@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=youquan.song@intel.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 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.