linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Pratik Sampat <psampat@linux.ibm.com>,
	rjw@rjwysocki.net, daniel.lezcano@linaro.org,
	srivatsa@csail.mit.edu, shuah@kernel.org, npiggin@gmail.com,
	ego@linux.vnet.ibm.com, svaidy@linux.ibm.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, pratik.r.sampat@gmail.com
Subject: Re: [RFC v4 1/1] selftests/cpuidle: Add support for cpuidle latency measurement
Date: Thu, 03 Sep 2020 17:50:25 +0300	[thread overview]
Message-ID: <9c5156274a86573ad592e6e431f3cbee8135b736.camel@gmail.com> (raw)
In-Reply-To: <fa616fed-66be-bcad-83b8-b1173a3a444f@linux.ibm.com>

On Thu, 2020-09-03 at 17:30 +0530, Pratik Sampat wrote:
> I certainly did not know about that the Intel architecture being aware
> of timers and pre-wakes the CPUs which makes the timer experiment
> observations void.

Well, things depend on platform, it is really "void", it is just
different and it measures an optimized case. The result may be smaller
observed latency. And things depend on the platform.

> However, we are also collecting a baseline measurement wherein we run
> the same test on a 100% busy CPU and the measurement of latency from
> that could be considered to the kernel-userspace overhead.
> The rest of the measurements would be considered keeping this baseline
> in mind.

Yes, this should give the idea of the overhead, but still, at least for
many Intel platforms I would not be comfortable using the resulting
number (measured latency - baseline) for a cpuidle driver, because
there are just too many variables there. I am not sure I could assume
the baseline measured this way is an invariant - it could be noticeably
different depending on whether you use C-states or not.

> > At least on Intel platforms, this will mean that the IPI method won't
> > cover deep C-states like, say, PC6, because one CPU is busy. Again, not
> > saying this is not interesting, just pointing out the limitation.
> 
> That's a valid point. We have similar deep idle states in POWER too.
> The idea here is that this test should be run on an already idle
> system, of course there will be kernel jitters along the way
> which can cause little skewness in observations across some CPUs but I
> believe the observations overall should be stable.

If baseline and cpuidle latency are numbers of same order of magnitude,
and you are measuring in a controlled lab system, may be yes. But if
baseline is, say, in milliseconds, and you are measuring a 10
microseconds C-state, then probably no.

> Another solution to this could be using isolcpus, but that just
> increases the complexity all the more.
> If you have any suggestions of any other way that could guarantee
> idleness that would be great.

Well, I did not try to guarantee idleness. I just use timers and
external device (the network card), so no CPUs needs to be busy and the
system can enter deep C-states. Then I just look at median, 99%-th
percentile, etc.

But by all means IPI is also a very interesting experiment. Just covers
a different usage scenario.

When I started experimenting in this area, one of my main early
takeaways was realization that C-state latency really depends on the
event source.

HTH,
Artem.


  reply	other threads:[~2020-09-03 14:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 11:45 [RFC v4 0/1] Selftest for cpuidle latency measurement Pratik Rajesh Sampat
2020-09-02 11:45 ` [RFC v4 1/1] selftests/cpuidle: Add support " Pratik Rajesh Sampat
2020-09-02 15:25   ` Artem Bityutskiy
2020-09-03 12:00     ` Pratik Sampat
2020-09-03 14:50       ` Artem Bityutskiy [this message]
2020-09-03 16:13         ` Artem Bityutskiy
2020-09-14  6:31         ` Pratik Sampat
2020-09-14 17:46   ` Gautham R Shenoy
2020-09-14 17:13 ` [RFC v4 0/1] Selftest " Gautham R Shenoy

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=9c5156274a86573ad592e6e431f3cbee8135b736.camel@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=ego@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=npiggin@gmail.com \
    --cc=pratik.r.sampat@gmail.com \
    --cc=psampat@linux.ibm.com \
    --cc=rjw@rjwysocki.net \
    --cc=shuah@kernel.org \
    --cc=srivatsa@csail.mit.edu \
    --cc=svaidy@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).