All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: vishwanath.sripathy@linaro.org
Cc: linux-omap@vger.kernel.org, linaro-dev@lists.linaro.org
Subject: Re: [PATCH] OMAP CPUIDLE: CPU Idle latency measurement
Date: Fri, 27 Aug 2010 12:15:18 -0700	[thread overview]
Message-ID: <87bp8nn9yx.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1282946913-26659-1-git-send-email-vishwanath.sripathy@linaro.org> (vishwanath sripathy's message of "Sat, 28 Aug 2010 03:38:33 +0530")

vishwanath.sripathy@linaro.org writes:

> From: Vishwanath BS <vishwanath.sripathy@linaro.org>
>
> This patch has instrumentation code for measuring latencies for
> various CPUIdle C states for OMAP. Idea here is to capture the
> timestamp at various phases of CPU Idle and then compute the sw
> latency for various c states.  For OMAP, 32k clock is chosen as
> reference clock this as is an always on clock.  wkup domain memory
> (scratchpad memory) is used for storing timestamps.  One can see the
> worstcase latencies in below sysfs entries (after enabling
> CONFIG_CPU_IDLE_PROF in .config). This information can be used to
> correctly configure cpu idle latencies for various C states after
> adding HW latencies for each of these sw latencies.
> /sys/devices/system/cpu/cpu0/cpuidle/state<n>/actual_latency
> /sys/devices/system/cpu/cpu0/cpuidle/state<n>/sleep_latency
> /sys/devices/system/cpu/cpu0/cpuidle/state<n>/wkup_latency
>
> THis patch is tested on OMAP ZOOM3 using kevin's pm branch.
>
> Signed-off-by: Vishwanath BS <vishwanath.sripathy@linaro.org>
> Cc: linaro-dev@lists.linaro.org

While I have many problems with the implementation details, I won't go
into them because in general this is the wrong direction for kernel
instrumentation.

This approach adds quite a bit overhead to the idle path itself.  With
all the reads/writes from/to the scratchpad(?) and all the multiplications
and divides in every idle path, as well as the wait-for-idlest in both
the sleep and resume paths.  The additional overhead added is non trivial.

Basically, I'd like get away from custom instrumentation and measurement
coded inside the kernel itself.  This kind of code never stops growing
and morphing into ugliness, and rarely scales well when new SoCs are
added.

With ftrace/perf, we can add tracepoints at specific points and use
external tools to extract and analyze the delays, latencys etc.

The point is to keep the minimum possible in the kernel: just the
tracepoints we're interested in.   The rest (calculations, averages,
analysis, etc.) does not need to be in the kernel and can be done easier
and with more powerful tools outside the kernel.

Kevin


  parent reply	other threads:[~2010-08-27 19:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27 22:08 [PATCH] OMAP CPUIDLE: CPU Idle latency measurement vishwanath.sripathy-QSEj5FYQhm4dnm+yROfE0A
2010-08-27  9:46 ` Jean Pihet
2010-08-27 10:00   ` Sripathy, Vishwanath
2010-08-27  9:58 ` Silesh C V
2010-08-27 10:00   ` Sripathy, Vishwanath
2010-08-27 10:25 ` Cousson, Benoit
2010-08-27 13:04   ` Jean Pihet
     [not found]   ` <4C7792AD.80804-l0cyMroinI0@public.gmane.org>
2010-08-27 13:41     ` Shilimkar, Santosh
2010-08-27 19:15 ` Kevin Hilman [this message]
2010-08-30 12:59   ` Sripathy, Vishwanath
2010-08-31  4:22     ` Silesh C V
2010-08-31  4:58       ` Sripathy, Vishwanath
2010-08-31  6:57         ` Silesh C V
2010-08-31  9:09           ` Sripathy, Vishwanath
     [not found]   ` <87bp8nn9yx.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2010-09-02  7:56     ` Amit Kucheria
     [not found]       ` <20100902075605.GB2962-HeifvKp/9wrwg6x6O6sdfg@public.gmane.org>
2010-09-02  8:11         ` Shilimkar, Santosh
     [not found]           ` <EAF47CD23C76F840A9E7FCE10091EFAB02CCED1488-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-09-02  9:08             ` Jean Pihet
2010-09-06 11:15               ` Sripathy, Vishwanath
     [not found]                 ` <FCCFB4CDC6E5564B9182F639FC356087031162CEB7-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-09-06 16:22                   ` Jean Pihet
2010-09-07  6:19                     ` Sripathy, Vishwanath
2010-09-02 17:55       ` Kevin Hilman
     [not found] ` <1282946913-26659-1-git-send-email-vishwanath.sripathy-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2010-08-27 20:28   ` Amit Kucheria
     [not found]     ` <20100827202842.GF2352-HeifvKp/9wrwg6x6O6sdfg@public.gmane.org>
2010-08-27 21:59       ` Kevin Hilman

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=87bp8nn9yx.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=vishwanath.sripathy@linaro.org \
    /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.