linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Doug Smythies" <dsmythies@telus.net>
To: 'Rik van Riel' <riel@redhat.com>
Cc: "'Rafael J. Wysocki'" <rafael@kernel.org>,
	"'Rafael J. Wysocki'" <rjw@rjwysocki.net>,
	'Viresh Kumar' <viresh.kumar@linaro.org>,
	'Srinivas Pandruvada' <srinivas.pandruvada@linux.intel.com>,
	"'Chen, Yu C'" <yu.c.chen@intel.com>,
	linux-pm@vger.kernel.org, 'Arto Jantunen' <viiru@iki.fi>,
	'Len Brown' <lenb@kernel.org>
Subject: RE: [PATCH] cpuidle: use high confidence factors only when considering polling
Date: Fri, 18 Mar 2016 13:59:39 -0700	[thread overview]
Message-ID: <004901d18159$18967100$49c35300$@net> (raw)
In-Reply-To: <20160318152957.5c3b91bc@annuminas.surriel.com>

On 2106.03.18 12:30 Rik van Riel wrote:
> On Fri, 18 Mar 2016 11:32:28 -0700 Doug Smythies wrote:
>> On 2016.03.18 06:12 Rafael J. Wysocki wrote:

>>> I'm wondering what happens if you replace the expected_interval in the
>>> "expected_interval >
>>> drv->states[CPUIDLE_DRIVER_STATE_START].target_residency" test with
>>> data->next_timer_us (with the Rik's patch applied, of course).  Can
>>> you please try doing that?  
>> 
>> O.K. my reference: rvr6 is the above modification to rvr5
>> It works as well as "reverted"/
>> 
>> State	k45rc7-rjw10-rvr6 (mins)
>> 0.00	0.87
>> 1.00	24.20
>> 2.00	4.05
>> 3.00	1.72
>> 4.00	147.50
>> 
>> total	178.34
>> 
>> Energy:
>> Kernel 4.5-rc7-rjw10-rvr6: 55864 Joules
>> 
>> Trace data (very crude summary):
>> Kernel 4.5-rc7-rjw10-rvr5: ~3049 long durations at high CPU load (idle state 0)
>> Kernel 4.5-rc7-rjw10-rvr5: ~183 long durations at high, but less, CPU load (not all idle state 0)
>
> What does "long duration" mean? 
> Dozens of microseconds?
> Hundreds of microseconds?
> Milliseconds?

On average, 100s of milliseconds, and as much as 4 seconds.

Specifically, for the Kernel 4.5-rc7-rjw10-rvr5 case, of 3049:
The average load was 97.2% and the average "Long" duration was 295.2 mSec.
Example 1: CPU 5 load 99.96% duration 1.96 seconds.
Example 2: CPU 5 load 99.74% duration 2.68 seconds.
Example 3: CPU 7 load 97.86% duration 2.30 seconds.

So, to repeat what I said the other day, but in another way:
The estimate can be correct 99.9% (or even more) of the time,
but when it isn't right, and the CPU gets left in idle state 0,
sometimes it can get left there for a very very long time.

> Either way, it appears there is something wrong with the
> code in get_typical_interval.  One of the problems is
> that calculating in microseconds, when working with a
> threshold of 1-2 microseconds is not going to work well,
> and secondly the code declares success the moment the
> standard deviation is below 20 microseconds, which is
> also not the best idea when dealing with 1-2 microsecond
> thresholds :)
>
> Does the below patch help?

I'll report back later on that part. The test computer is busy
with something else at the moment.

... Doug



  reply	other threads:[~2016-03-18 20:59 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 17:51 SKL BOOT FAILURE unless idle=nomwait (was Re: PROBLEM: Cpufreq constantly keeps frequency at maximum on 4.5-rc4) Len Brown
     [not found] ` <87si087tsr.fsf@iki.fi>
2016-03-02 17:10   ` Rik van Riel
2016-03-08 21:13     ` Len Brown
2016-03-08 21:19   ` Len Brown
2016-03-09 17:01     ` Arto Jantunen
2016-03-09 23:03       ` Doug Smythies
2016-03-09 23:18         ` Rafael J. Wysocki
2016-03-09 23:45           ` Doug Smythies
2016-03-09 23:59             ` Rafael J. Wysocki
2016-03-11 14:03               ` Rik van Riel
2016-03-11 18:22                 ` Doug Smythies
2016-03-11 20:30                   ` Rik van Riel
2016-03-11 23:54                     ` Rafael J. Wysocki
2016-03-12  0:46                       ` Doug Smythies
2016-03-12  1:45                         ` Rafael J. Wysocki
2016-03-12  2:02                           ` Rafael J. Wysocki
2016-03-13  7:46                             ` Doug Smythies
2016-03-14  1:32                               ` Rafael J. Wysocki
2016-03-14  6:39                                 ` Doug Smythies
2016-03-14 12:47                                   ` Rafael J. Wysocki
2016-03-14 14:31                                     ` Rik van Riel
2016-03-14 15:21                                       ` Rafael J. Wysocki
2016-03-14 17:45                                         ` Rik van Riel
2016-03-14 22:55                                           ` Rafael J. Wysocki
2016-03-15  2:03                                             ` Rik van Riel
2016-03-16  0:32                                               ` Rafael J. Wysocki
2016-03-16  0:37                                                 ` Rafael J. Wysocki
2016-03-16  0:55                                                 ` Rik van Riel
2016-03-16  1:53                                                   ` Rafael J. Wysocki
2016-03-16 13:02                                                     ` Rafael J. Wysocki
2016-03-16 14:01                                                       ` Rik van Riel
2016-03-16 14:14                                                         ` Rafael J. Wysocki
2016-03-16 14:46                                                           ` Rik van Riel
2016-03-16 15:05                                                             ` Rafael J. Wysocki
2016-03-16 15:07                                                               ` Rik van Riel
2016-03-16 15:09                                                                 ` Rafael J. Wysocki
2016-03-16 16:14                                                                   ` [PATCH] cpuidle: use high confidence factors only when considering polling Rik van Riel
2016-03-18  0:45                                                                     ` Rafael J. Wysocki
2016-03-18  6:32                                                                       ` Doug Smythies
2016-03-18 13:11                                                                         ` Rafael J. Wysocki
2016-03-18 18:32                                                                           ` Doug Smythies
2016-03-18 19:29                                                                             ` Rik van Riel
2016-03-18 20:59                                                                               ` Doug Smythies [this message]
2016-03-18 21:24                                                                               ` Rafael J. Wysocki
2016-03-18 21:26                                                                                 ` Rik van Riel
2016-03-18 23:40                                                                               ` Rafael J. Wysocki
2016-03-18 21:35                                                                             ` Rik van Riel
2016-03-18 21:48                                                                               ` Rafael J. Wysocki
2016-03-18 21:52                                                                                 ` Rik van Riel
2016-03-18 22:09                                                                                   ` Rafael J. Wysocki
2016-03-18 22:28                                                                                     ` Rik van Riel
2016-03-18 23:29                                                                                       ` Rafael J. Wysocki
2016-03-18 21:56                                                                                 ` Rafael J. Wysocki
2016-03-18 22:38                                                                                   ` Rafael J. Wysocki
2016-03-18 22:56                                                                               ` Rafael J. Wysocki
2016-03-19  1:53                                                                                 ` Rik van Riel
2016-03-19  2:06                                                                                   ` Rafael J. Wysocki
2016-03-19  2:17                                                                                     ` Rik van Riel
2016-03-19  2:33                                                                                       ` 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='004901d18159$18967100$49c35300$@net' \
    --to=dsmythies@telus.net \
    --cc=lenb@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=riel@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=viiru@iki.fi \
    --cc=viresh.kumar@linaro.org \
    --cc=yu.c.chen@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 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).