public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, Leo Yan <leo.yan@linaro.org>,
	Frederic Weisbecker <frederic@kernel.org>
Subject: Re: [PATCH v5] cpuidle: menu: Handle stopped tick more aggressively
Date: Mon, 20 Aug 2018 13:02:54 +0200	[thread overview]
Message-ID: <20180820110254.GX2494@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1572343.jWaXB8XNF1@aspire.rjw.lan>

On Tue, Aug 14, 2018 at 12:34:40PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Commit 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states
> with stopped tick) missed the case when the target residencies of
> deep idle states of CPUs are above the tick boundary which may cause
> the CPU to get stuck in a shallow idle state for a long time.
> 
> Say there are two CPU idle states available: one shallow, with the
> target residency much below the tick boundary and one deep, with
> the target residency significantly above the tick boundary.  In
> that case, if the tick has been stopped already and the expected
> next timer event is relatively far in the future, the governor will
> assume the idle duration to be equal to TICK_USEC and it will select
> the idle state for the CPU accordingly.  However, that will cause the
> shallow state to be selected even though it would have been more
> energy-efficient to select the deep one.
> 
> To address this issue, modify the governor to always use the time
> till the closest timer event instead of the predicted idle duration
> if the latter is less than the tick period length and the tick has
> been stopped already.  Also make it extend the search for a matching
> idle state if the tick is stopped to avoid settling on a shallow
> state if deep states with target residencies above the tick period
> length are available.
> 
> In addition, make it always indicate that the tick should be stopped
> if it has been stopped already for consistency.
> 
> Fixes: 87c9fe6ee495 (cpuidle: menu: Avoid selecting shallow states with stopped tick)
> Reported-by: Leo Yan <leo.yan@linaro.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Seems OK,

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

  parent reply	other threads:[~2018-08-20 11:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-10  7:34 [PATCH] cpuidle: menu: Handle stopped tick more aggressively Rafael J. Wysocki
2018-08-10  7:57 ` [PATCH v2] " Rafael J. Wysocki
2018-08-10  9:20   ` leo.yan
2018-08-10 11:04     ` Rafael J. Wysocki
2018-08-10 12:31       ` leo.yan
2018-08-12 10:07         ` Rafael J. Wysocki
2018-08-12 13:44           ` leo.yan
2018-08-13  7:58             ` Rafael J. Wysocki
2018-08-10 11:15   ` [PATCH v3] " Rafael J. Wysocki
2018-08-12 14:55     ` leo.yan
2018-08-13  8:11       ` Rafael J. Wysocki
2018-08-20 10:15       ` Peter Zijlstra
2018-08-13 11:26     ` [PATCH v4] " Rafael J. Wysocki
2018-08-14 10:34       ` [PATCH v5] " Rafael J. Wysocki
2018-08-14 15:44         ` leo.yan
2018-08-14 17:26           ` Rafael J. Wysocki
2018-08-20 11:04           ` Peter Zijlstra
2018-08-20 11:02         ` Peter Zijlstra [this message]
2018-08-11 16:32 ` [PATCH] " kbuild test robot
2018-08-12 22:13 ` Dan Carpenter

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=20180820110254.GX2494@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=frederic@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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