linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Doug Smythies <dsmythies@telus.net>
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: SKL BOOT FAILURE unless idle=nomwait (was Re: PROBLEM: Cpufreq constantly keeps frequency at maximum on 4.5-rc4)
Date: Fri, 11 Mar 2016 15:30:44 -0500	[thread overview]
Message-ID: <20160311153044.1a3be1c6@annuminas.surriel.com> (raw)
In-Reply-To: <002401d17bc2$fad32af0$f07980d0$@net>

On Fri, 11 Mar 2016 10:22:30 -0800
"Doug Smythies" <dsmythies@telus.net> wrote:

> On 2016.03.11 06:03 Rik van Riel wrote:
> > On Thu, 10 Mar 2016 00:59:01 +0100 "Rafael J. Wysocki" <rafael@kernel.org> wrote:

> > The patch below should fix that.
> >
> > It didn't for Arto, due to the other issues on his system, but
> > it might resolve the issue for Doug, where cstate/pstate is
> > otherwise working fine.
> >
> > Doug, does the patch below solve your issue?
> 
> No.

OK, lets try doing this check a little more aggressively, since there
almost certainly are good reasons why the main selection loop in
menu_select() so aggressively tries to stay with shallower C states.

With the patch below, we compare the (not corrected for load) expected
sleep time against the target residency of the C1 (hlt) state on the CPU.

This might resolve the issue, while still doing the right thing on CPUs
that have really high C1 latencies (eg. Atom).

Does this resolve the issue for you?

---8<---

Subject: cpuidle: use predicted_us not interactivity_req to consider polling

The interactivity_req variable is the expected sleep time, divided
by the CPU load. This can be too aggressive a factor in deciding
whether or not to consider polling in the cpuidle state selection.

Use the (not corrected for load) predicted_us instead, and compare
it against the target residency of C1 (hlt).

Signed-off-by: Rik van Riel <riel@redhat.com>
---
 drivers/cpuidle/governors/menu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 0742b3296673..7dda15cfe547 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -330,7 +330,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 		 * We want to default to C1 (hlt), not to busy polling
 		 * unless the timer is happening really really soon.
 		 */
-		if (interactivity_req > 20 &&
+		if (data->predicted_us > drv->states[CPUIDLE_DRIVER_STATE_START].target_residency &&
 		    !drv->states[CPUIDLE_DRIVER_STATE_START].disabled &&
 			dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
 			data->last_state_idx = CPUIDLE_DRIVER_STATE_START;


  reply	other threads:[~2016-03-11 20:30 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 [this message]
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
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=20160311153044.1a3be1c6@annuminas.surriel.com \
    --to=riel@redhat.com \
    --cc=dsmythies@telus.net \
    --cc=lenb@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --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).