All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] doc: coresight: correct usage for disabling idle states
@ 2017-09-20  4:46 ` Leo Yan
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Yan @ 2017-09-20  4:46 UTC (permalink / raw)
  To: Mathieu Poirier, Jonathan Corbet, linux-arm-kernel, linux-doc,
	linux-kernel, Kim Phillips
  Cc: Leo Yan, Sudeep Holla

In the coresight CPU debug document it suggests to use 'echo' command
to set latency request to /dev/cpu_dma_latency so can disable all CPU
idle states, but in fact this doesn't work.

This is because when the command 'echo' exits, it releases the device
node's file descriptor and the kernel release function removes the QoS
constraint; finally when the command 'echo' finished there have no
constraint imposed on cpu_dma_latency.

This patch changes to use 'exec' to access '/dev/cpu_dma_latency', the
command 'exec' can avoid the file descriptor to be closed so we can
keep the constraint on cpu_dma_latency.

This patch also adds the info for reference docs for PM QoS and cpuidle
sysfs.

Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reported-by: Kim Phillips <kim.phillips@arm.com>
Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 Documentation/trace/coresight-cpu-debug.txt | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt
index b3da1f9..2b9b51c 100644
--- a/Documentation/trace/coresight-cpu-debug.txt
+++ b/Documentation/trace/coresight-cpu-debug.txt
@@ -149,11 +149,23 @@ If you want to limit idle states at boot time, you can use "nohlt" or
 
 At the runtime you can disable idle states with below methods:
 
-Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle
-states (if latency = 0uS then disable all idle states):
-# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency
-
-Disable specific CPU's specific idle state:
+It is possible to disable CPU idle states by way of the PM QoS
+subsystem, more specifically by using the "/dev/cpu_dma_latency"
+interface (see Documentation/power/pm_qos_interface.txt for more
+details).  As specified in the PM QoS documentation the requested
+parameter will stay in effect until the file descriptor is released.
+For example:
+
+# exec 3<> /dev/cpu_dma_latency; echo 0 >&3
+...
+Do some work...
+...
+# exec 3<>-
+
+The same can also be done from an application program.
+
+Disable specific CPU's specific idle state from cpuidle sysfs (see
+Documentation/cpuidle/sysfs.txt):
 # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
 
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3] doc: coresight: correct usage for disabling idle states
@ 2017-09-20  4:46 ` Leo Yan
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Yan @ 2017-09-20  4:46 UTC (permalink / raw)
  To: linux-arm-kernel

In the coresight CPU debug document it suggests to use 'echo' command
to set latency request to /dev/cpu_dma_latency so can disable all CPU
idle states, but in fact this doesn't work.

This is because when the command 'echo' exits, it releases the device
node's file descriptor and the kernel release function removes the QoS
constraint; finally when the command 'echo' finished there have no
constraint imposed on cpu_dma_latency.

This patch changes to use 'exec' to access '/dev/cpu_dma_latency', the
command 'exec' can avoid the file descriptor to be closed so we can
keep the constraint on cpu_dma_latency.

This patch also adds the info for reference docs for PM QoS and cpuidle
sysfs.

Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reported-by: Kim Phillips <kim.phillips@arm.com>
Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 Documentation/trace/coresight-cpu-debug.txt | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt
index b3da1f9..2b9b51c 100644
--- a/Documentation/trace/coresight-cpu-debug.txt
+++ b/Documentation/trace/coresight-cpu-debug.txt
@@ -149,11 +149,23 @@ If you want to limit idle states at boot time, you can use "nohlt" or
 
 At the runtime you can disable idle states with below methods:
 
-Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle
-states (if latency = 0uS then disable all idle states):
-# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency
-
-Disable specific CPU's specific idle state:
+It is possible to disable CPU idle states by way of the PM QoS
+subsystem, more specifically by using the "/dev/cpu_dma_latency"
+interface (see Documentation/power/pm_qos_interface.txt for more
+details).  As specified in the PM QoS documentation the requested
+parameter will stay in effect until the file descriptor is released.
+For example:
+
+# exec 3<> /dev/cpu_dma_latency; echo 0 >&3
+...
+Do some work...
+...
+# exec 3<>-
+
+The same can also be done from an application program.
+
+Disable specific CPU's specific idle state from cpuidle sysfs (see
+Documentation/cpuidle/sysfs.txt):
 # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
 
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] doc: coresight: correct usage for disabling idle states
  2017-09-20  4:46 ` Leo Yan
@ 2017-10-02 18:14   ` Mathieu Poirier
  -1 siblings, 0 replies; 6+ messages in thread
From: Mathieu Poirier @ 2017-10-02 18:14 UTC (permalink / raw)
  To: Leo Yan
  Cc: Jonathan Corbet, linux-arm-kernel, open list:DOCUMENTATION,
	linux-kernel, Kim Phillips, Sudeep Holla

On 19 September 2017 at 21:46, Leo Yan <leo.yan@linaro.org> wrote:
> In the coresight CPU debug document it suggests to use 'echo' command
> to set latency request to /dev/cpu_dma_latency so can disable all CPU
> idle states, but in fact this doesn't work.
>
> This is because when the command 'echo' exits, it releases the device
> node's file descriptor and the kernel release function removes the QoS
> constraint; finally when the command 'echo' finished there have no
> constraint imposed on cpu_dma_latency.
>
> This patch changes to use 'exec' to access '/dev/cpu_dma_latency', the
> command 'exec' can avoid the file descriptor to be closed so we can
> keep the constraint on cpu_dma_latency.
>
> This patch also adds the info for reference docs for PM QoS and cpuidle
> sysfs.
>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Reported-by: Kim Phillips <kim.phillips@arm.com>
> Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  Documentation/trace/coresight-cpu-debug.txt | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt
> index b3da1f9..2b9b51c 100644
> --- a/Documentation/trace/coresight-cpu-debug.txt
> +++ b/Documentation/trace/coresight-cpu-debug.txt
> @@ -149,11 +149,23 @@ If you want to limit idle states at boot time, you can use "nohlt" or
>
>  At the runtime you can disable idle states with below methods:
>
> -Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle
> -states (if latency = 0uS then disable all idle states):
> -# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency
> -
> -Disable specific CPU's specific idle state:
> +It is possible to disable CPU idle states by way of the PM QoS
> +subsystem, more specifically by using the "/dev/cpu_dma_latency"
> +interface (see Documentation/power/pm_qos_interface.txt for more
> +details).  As specified in the PM QoS documentation the requested
> +parameter will stay in effect until the file descriptor is released.
> +For example:
> +
> +# exec 3<> /dev/cpu_dma_latency; echo 0 >&3
> +...
> +Do some work...
> +...
> +# exec 3<>-
> +
> +The same can also be done from an application program.
> +
> +Disable specific CPU's specific idle state from cpuidle sysfs (see
> +Documentation/cpuidle/sysfs.txt):
>  # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
>

Applied.

Thanks,
Mathieu

>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3] doc: coresight: correct usage for disabling idle states
@ 2017-10-02 18:14   ` Mathieu Poirier
  0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Poirier @ 2017-10-02 18:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 19 September 2017 at 21:46, Leo Yan <leo.yan@linaro.org> wrote:
> In the coresight CPU debug document it suggests to use 'echo' command
> to set latency request to /dev/cpu_dma_latency so can disable all CPU
> idle states, but in fact this doesn't work.
>
> This is because when the command 'echo' exits, it releases the device
> node's file descriptor and the kernel release function removes the QoS
> constraint; finally when the command 'echo' finished there have no
> constraint imposed on cpu_dma_latency.
>
> This patch changes to use 'exec' to access '/dev/cpu_dma_latency', the
> command 'exec' can avoid the file descriptor to be closed so we can
> keep the constraint on cpu_dma_latency.
>
> This patch also adds the info for reference docs for PM QoS and cpuidle
> sysfs.
>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Reported-by: Kim Phillips <kim.phillips@arm.com>
> Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  Documentation/trace/coresight-cpu-debug.txt | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt
> index b3da1f9..2b9b51c 100644
> --- a/Documentation/trace/coresight-cpu-debug.txt
> +++ b/Documentation/trace/coresight-cpu-debug.txt
> @@ -149,11 +149,23 @@ If you want to limit idle states at boot time, you can use "nohlt" or
>
>  At the runtime you can disable idle states with below methods:
>
> -Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle
> -states (if latency = 0uS then disable all idle states):
> -# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency
> -
> -Disable specific CPU's specific idle state:
> +It is possible to disable CPU idle states by way of the PM QoS
> +subsystem, more specifically by using the "/dev/cpu_dma_latency"
> +interface (see Documentation/power/pm_qos_interface.txt for more
> +details).  As specified in the PM QoS documentation the requested
> +parameter will stay in effect until the file descriptor is released.
> +For example:
> +
> +# exec 3<> /dev/cpu_dma_latency; echo 0 >&3
> +...
> +Do some work...
> +...
> +# exec 3<>-
> +
> +The same can also be done from an application program.
> +
> +Disable specific CPU's specific idle state from cpuidle sysfs (see
> +Documentation/cpuidle/sysfs.txt):
>  # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
>

Applied.

Thanks,
Mathieu

>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] doc: coresight: correct usage for disabling idle states
  2017-10-02 18:14   ` Mathieu Poirier
@ 2017-10-04  8:13     ` Leo Yan
  -1 siblings, 0 replies; 6+ messages in thread
From: Leo Yan @ 2017-10-04  8:13 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: Jonathan Corbet, linux-arm-kernel, open list:DOCUMENTATION,
	linux-kernel, Kim Phillips, Sudeep Holla

On Mon, Oct 02, 2017 at 11:14:46AM -0700, Mathieu Poirier wrote:
> On 19 September 2017 at 21:46, Leo Yan <leo.yan@linaro.org> wrote:
> > In the coresight CPU debug document it suggests to use 'echo' command
> > to set latency request to /dev/cpu_dma_latency so can disable all CPU
> > idle states, but in fact this doesn't work.
> >
> > This is because when the command 'echo' exits, it releases the device
> > node's file descriptor and the kernel release function removes the QoS
> > constraint; finally when the command 'echo' finished there have no
> > constraint imposed on cpu_dma_latency.
> >
> > This patch changes to use 'exec' to access '/dev/cpu_dma_latency', the
> > command 'exec' can avoid the file descriptor to be closed so we can
> > keep the constraint on cpu_dma_latency.
> >
> > This patch also adds the info for reference docs for PM QoS and cpuidle
> > sysfs.
> >
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Reported-by: Kim Phillips <kim.phillips@arm.com>
> > Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > ---
> >  Documentation/trace/coresight-cpu-debug.txt | 22 +++++++++++++++++-----
> >  1 file changed, 17 insertions(+), 5 deletions(-)
> >
> > diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt
> > index b3da1f9..2b9b51c 100644
> > --- a/Documentation/trace/coresight-cpu-debug.txt
> > +++ b/Documentation/trace/coresight-cpu-debug.txt
> > @@ -149,11 +149,23 @@ If you want to limit idle states at boot time, you can use "nohlt" or
> >
> >  At the runtime you can disable idle states with below methods:
> >
> > -Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle
> > -states (if latency = 0uS then disable all idle states):
> > -# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency
> > -
> > -Disable specific CPU's specific idle state:
> > +It is possible to disable CPU idle states by way of the PM QoS
> > +subsystem, more specifically by using the "/dev/cpu_dma_latency"
> > +interface (see Documentation/power/pm_qos_interface.txt for more
> > +details).  As specified in the PM QoS documentation the requested
> > +parameter will stay in effect until the file descriptor is released.
> > +For example:
> > +
> > +# exec 3<> /dev/cpu_dma_latency; echo 0 >&3
> > +...
> > +Do some work...
> > +...
> > +# exec 3<>-
> > +
> > +The same can also be done from an application program.
> > +
> > +Disable specific CPU's specific idle state from cpuidle sysfs (see
> > +Documentation/cpuidle/sysfs.txt):
> >  # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
> >
> 
> Applied.

Thanks a lot, Mathieu.

> Thanks,
> Mathieu
> 
> >
> > --
> > 2.7.4
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3] doc: coresight: correct usage for disabling idle states
@ 2017-10-04  8:13     ` Leo Yan
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Yan @ 2017-10-04  8:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 02, 2017 at 11:14:46AM -0700, Mathieu Poirier wrote:
> On 19 September 2017 at 21:46, Leo Yan <leo.yan@linaro.org> wrote:
> > In the coresight CPU debug document it suggests to use 'echo' command
> > to set latency request to /dev/cpu_dma_latency so can disable all CPU
> > idle states, but in fact this doesn't work.
> >
> > This is because when the command 'echo' exits, it releases the device
> > node's file descriptor and the kernel release function removes the QoS
> > constraint; finally when the command 'echo' finished there have no
> > constraint imposed on cpu_dma_latency.
> >
> > This patch changes to use 'exec' to access '/dev/cpu_dma_latency', the
> > command 'exec' can avoid the file descriptor to be closed so we can
> > keep the constraint on cpu_dma_latency.
> >
> > This patch also adds the info for reference docs for PM QoS and cpuidle
> > sysfs.
> >
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: Sudeep Holla <sudeep.holla@arm.com>
> > Reported-by: Kim Phillips <kim.phillips@arm.com>
> > Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > ---
> >  Documentation/trace/coresight-cpu-debug.txt | 22 +++++++++++++++++-----
> >  1 file changed, 17 insertions(+), 5 deletions(-)
> >
> > diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt
> > index b3da1f9..2b9b51c 100644
> > --- a/Documentation/trace/coresight-cpu-debug.txt
> > +++ b/Documentation/trace/coresight-cpu-debug.txt
> > @@ -149,11 +149,23 @@ If you want to limit idle states at boot time, you can use "nohlt" or
> >
> >  At the runtime you can disable idle states with below methods:
> >
> > -Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle
> > -states (if latency = 0uS then disable all idle states):
> > -# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency
> > -
> > -Disable specific CPU's specific idle state:
> > +It is possible to disable CPU idle states by way of the PM QoS
> > +subsystem, more specifically by using the "/dev/cpu_dma_latency"
> > +interface (see Documentation/power/pm_qos_interface.txt for more
> > +details).  As specified in the PM QoS documentation the requested
> > +parameter will stay in effect until the file descriptor is released.
> > +For example:
> > +
> > +# exec 3<> /dev/cpu_dma_latency; echo 0 >&3
> > +...
> > +Do some work...
> > +...
> > +# exec 3<>-
> > +
> > +The same can also be done from an application program.
> > +
> > +Disable specific CPU's specific idle state from cpuidle sysfs (see
> > +Documentation/cpuidle/sysfs.txt):
> >  # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable
> >
> 
> Applied.

Thanks a lot, Mathieu.

> Thanks,
> Mathieu
> 
> >
> > --
> > 2.7.4
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-04  8:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-20  4:46 [PATCH v3] doc: coresight: correct usage for disabling idle states Leo Yan
2017-09-20  4:46 ` Leo Yan
2017-10-02 18:14 ` Mathieu Poirier
2017-10-02 18:14   ` Mathieu Poirier
2017-10-04  8:13   ` Leo Yan
2017-10-04  8:13     ` Leo Yan

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.