From mboxrd@z Thu Jan  1 00:00:00 1970
From: riel@redhat.com
Subject: [PATCH 1/3] cpuidle,x86: increase forced cut-off for polling to 20us
Date: Tue,  3 Nov 2015 17:34:17 -0500
Message-ID: <1446590059-18897-2-git-send-email-riel@redhat.com>
References: <1446590059-18897-1-git-send-email-riel@redhat.com>
Return-path: <linux-kernel-owner@vger.kernel.org>
In-Reply-To: <1446590059-18897-1-git-send-email-riel@redhat.com>
Sender: linux-kernel-owner@vger.kernel.org
To: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, rafael.j.wysocki@intel.com, arjan@linux.intel.com, len.brown@intel.com, daniel.lezcano@linaro.org
List-Id: linux-pm@vger.kernel.org

From: Rik van Riel <riel@redhat.com>

The cpuidle menu governor has a forced cut-off for polling at 5us,
in order to deal with firmware that gives the OS bad information
on cpuidle states, leading to the system spending way too much time
in polling.

However, at least one x86 CPU family (Atom) has chips that have
a 20us break-even point for C1. Forcing the polling cut-off to
less than that wastes performance and power.

Increase the polling cut-off to 20us.

Systems with a lower C1 latency will be found in the states table by
the menu governor, which will pick those states as appropriate.

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 22e4463d1787..ecc242a586c9 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 (data->next_timer_us > 5 &&
+	if (data->next_timer_us > 20 &&
 	    !drv->states[CPUIDLE_DRIVER_STATE_START].disabled &&
 		dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
 		data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
-- 
2.1.0

From mboxrd@z Thu Jan  1 00:00:00 1970
From: Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [PATCH 1/3] cpuidle,x86: increase forced cut-off for polling to
 20us
Date: Wed, 4 Nov 2015 08:00:52 -0800
Message-ID: <563A2BB4.1050709@linux.intel.com>
References: <1446590059-18897-1-git-send-email-riel@redhat.com>
 <1446590059-18897-2-git-send-email-riel@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Return-path: <linux-kernel-owner@vger.kernel.org>
In-Reply-To: <1446590059-18897-2-git-send-email-riel@redhat.com>
Sender: linux-kernel-owner@vger.kernel.org
To: riel@redhat.com, linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, rafael.j.wysocki@intel.com, len.brown@intel.com, daniel.lezcano@linaro.org
List-Id: linux-pm@vger.kernel.org

Acked-by: Arjan van de Ven <arjan@linux.intel.com>

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1756488AbbJ1XF3 (ORCPT <rfc822;w@1wt.eu>);
	Wed, 28 Oct 2015 19:05:29 -0400
Received: from shelob.surriel.com ([74.92.59.67]:58278 "EHLO
	shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S1756312AbbJ1XFI (ORCPT
	<rfc822;linux-kernel@vger.kernel.org>);
	Wed, 28 Oct 2015 19:05:08 -0400
From: riel@redhat.com
To: linux-kernel@vger.kernel.org
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org,
        javi.merino@arm.com, tuukka.tikkanen@linaro.org
Subject: [PATCH 0/3] cpuidle: small improvements & fixes for menu governor
Date: Wed, 28 Oct 2015 18:46:53 -0400
Message-Id: <1446072416-13622-1-git-send-email-riel@redhat.com>
X-Mailer: git-send-email 2.1.0
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

While working on a paravirt cpuidle driver for KVM guests, I
noticed a number of small logic errors in the menu governor
code.

These patches should get rid of some artifacts that can break
the logic in the menu governor under certain corner cases, and
make idle state selection work better on CPUs with long C1 exit
latencies.

I have not seen any adverse effects with them in my (quick)
tests. As expected, they do not seem to do much on systems with
many power states and very low C1 exit latencies and target residencies.


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1756414AbbJ1XFJ (ORCPT <rfc822;w@1wt.eu>);
	Wed, 28 Oct 2015 19:05:09 -0400
Received: from shelob.surriel.com ([74.92.59.67]:58276 "EHLO
	shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S1755970AbbJ1XFG (ORCPT
	<rfc822;linux-kernel@vger.kernel.org>);
	Wed, 28 Oct 2015 19:05:06 -0400
From: riel@redhat.com
To: linux-kernel@vger.kernel.org
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org,
        javi.merino@arm.com, tuukka.tikkanen@linaro.org
Subject: [PATCH 1/3] cpuidle,x86: increase forced cut-off for polling to 20us
Date: Wed, 28 Oct 2015 18:46:54 -0400
Message-Id: <1446072416-13622-2-git-send-email-riel@redhat.com>
X-Mailer: git-send-email 2.1.0
In-Reply-To: <1446072416-13622-1-git-send-email-riel@redhat.com>
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

From: Rik van Riel <riel@redhat.com>

The cpuidle menu governor has a forced cut-off for polling at 5us,
in order to deal with firmware that gives the OS bad information
on cpuidle states, leading to the system spending way too much time
in polling.

However, at least one x86 CPU family (Atom) has chips that have
a 20us break-even point for C1. Forcing the polling cut-off to
less than that wastes performance and power.

Increase the polling cut-off to 20us.

Systems with a lower C1 latency will be found in the states table by
the menu governor, which will pick those states as appropriate.

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 22e4463d1787..ecc242a586c9 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 (data->next_timer_us > 5 &&
+	if (data->next_timer_us > 20 &&
 	    !drv->states[CPUIDLE_DRIVER_STATE_START].disabled &&
 		dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
 		data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
-- 
2.1.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1756518AbbJ1XFs (ORCPT <rfc822;w@1wt.eu>);
	Wed, 28 Oct 2015 19:05:48 -0400
Received: from shelob.surriel.com ([74.92.59.67]:58277 "EHLO
	shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S1756213AbbJ1XFH (ORCPT
	<rfc822;linux-kernel@vger.kernel.org>);
	Wed, 28 Oct 2015 19:05:07 -0400
From: riel@redhat.com
To: linux-kernel@vger.kernel.org
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org,
        javi.merino@arm.com, tuukka.tikkanen@linaro.org
Subject: [PATCH 2/3] cpuidle,menu: use interactivity_req to disable polling
Date: Wed, 28 Oct 2015 18:46:55 -0400
Message-Id: <1446072416-13622-3-git-send-email-riel@redhat.com>
X-Mailer: git-send-email 2.1.0
In-Reply-To: <1446072416-13622-1-git-send-email-riel@redhat.com>
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

From: Rik van Riel <riel@redhat.com>

The menu governor carefully figures out how much time we typically
sleep for an estimated sleep interval, or whether there is a repeating
pattern going on, and corrects that estimate for the CPU load.

Then it proceeds to ignore that information when determining whether
or not to consider polling. This is not a big deal on most x86 CPUs,
which have very low C1 latencies, and the patch should not have any
effect on those CPUs.

However, certain CPUs (eg. Atom) have much higher C1 latencies, and
it would be good to not waste performance and power on those CPUs if
we are expecting a very low wakeup latency.

Disable polling based on the estimated interactivity requirement, not
on the time to the next timer interrupt.

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 ecc242a586c9..b1a55731f921 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 (data->next_timer_us > 20 &&
+	if (interactivity_req > 20 &&
 	    !drv->states[CPUIDLE_DRIVER_STATE_START].disabled &&
 		dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
 		data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
-- 
2.1.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1756015AbbJ1XFF (ORCPT <rfc822;w@1wt.eu>);
	Wed, 28 Oct 2015 19:05:05 -0400
Received: from shelob.surriel.com ([74.92.59.67]:58274 "EHLO
	shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S1752063AbbJ1XFE (ORCPT
	<rfc822;linux-kernel@vger.kernel.org>);
	Wed, 28 Oct 2015 19:05:04 -0400
X-Greylist: delayed 1082 seconds by postgrey-1.27 at vger.kernel.org; Wed, 28 Oct 2015 19:05:04 EDT
From: riel@redhat.com
To: linux-kernel@vger.kernel.org
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org,
        javi.merino@arm.com, tuukka.tikkanen@linaro.org
Subject: [PATCH 3/3] cpuidle,menu: smooth out measured_us calculation
Date: Wed, 28 Oct 2015 18:46:56 -0400
Message-Id: <1446072416-13622-4-git-send-email-riel@redhat.com>
X-Mailer: git-send-email 2.1.0
In-Reply-To: <1446072416-13622-1-git-send-email-riel@redhat.com>
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

From: Rik van Riel <riel@redhat.com>

The cpuidle state tables contain the maximum exit latency for each
cpuidle state. On x86, that is the exit latency for when the entire
package goes into that same idle state.

However, a lot of the time we only go into the core idle state,
not the package idle state. This means we see a much smaller exit
latency.

We have no way to detect whether we went into the core or package
idle state while idle, and that is ok.

However, the current menu_update logic does have the potential to
trip up the repeating pattern detection in get_typical_interval.
If the system is experiencing an exit latency near the idle state's
exit latency, some of the samples will have exit_us subtracted,
while others will not. This turns a repeating pattern into mush,
potentially breaking get_typical_interval.

Furthermore, for smaller sleep intervals, we know the chance that
all the cores in the package went to the same idle state are fairly
small. Dividing the measured_us by two, instead of subtracting the
full exit latency when hitting a small measured_us, will reduce the
error.

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

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index b1a55731f921..7b0971d97cc3 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -404,8 +404,10 @@ static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 	measured_us = cpuidle_get_last_residency(dev);
 
 	/* Deduct exit latency */
-	if (measured_us > target->exit_latency)
+	if (measured_us > 2 * target->exit_latency)
 		measured_us -= target->exit_latency;
+	else
+		measured_us /= 2;
 
 	/* Make sure our coefficients do not exceed unity */
 	if (measured_us > data->next_timer_us)
-- 
2.1.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1756413AbbJ2KRz (ORCPT <rfc822;w@1wt.eu>);
	Thu, 29 Oct 2015 06:17:55 -0400
Received: from mail-wi0-f177.google.com ([209.85.212.177]:35708 "EHLO
	mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S1751282AbbJ2KRy (ORCPT
	<rfc822;linux-kernel@vger.kernel.org>);
	Thu, 29 Oct 2015 06:17:54 -0400
Subject: Re: [PATCH 1/3] cpuidle,x86: increase forced cut-off for polling to
 20us
To: riel@redhat.com, linux-kernel@vger.kernel.org
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
 <1446072416-13622-2-git-send-email-riel@redhat.com>
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        rafael.j.wysocki@intel.com, javi.merino@arm.com,
        tuukka.tikkanen@linaro.org
From: Daniel Lezcano <daniel.lezcano@linaro.org>
Message-ID: <5631F24E.2060508@linaro.org>
Date: Thu, 29 Oct 2015 11:17:50 +0100
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <1446072416-13622-2-git-send-email-riel@redhat.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On 10/28/2015 11:46 PM, riel@redhat.com wrote:
> From: Rik van Riel <riel@redhat.com>
>
> The cpuidle menu governor has a forced cut-off for polling at 5us,
> in order to deal with firmware that gives the OS bad information
> on cpuidle states, leading to the system spending way too much time
> in polling.

May be I am misunderstanding your explanation but it is not how I read 
the code.

The default idle state is C1 (hlt) if no other states suits the 
constraint. If a timer is happening really soon, then set the default 
idle state to POLL if no other idle state suits the constraint.

That applies only on x86.

This is not related to break-even but exit latency.

IMO, we should just drop this 5us and the POLL state selection in the 
menu governor as we have since a while hyper fast C1 exit. Except a few 
embedded processors where polling is not adequate.

Furthermore, the number of times the poll state is selected vs the other 
states is negligible.

I already raised this point but Len is opposed to the removal.

Len ? Can you elaborate why you are opposed to this removal ?

> However, at least one x86 CPU family (Atom) has chips that have
> a 20us break-even point for C1. Forcing the polling cut-off to
> less than that wastes performance and power.
>
> Increase the polling cut-off to 20us.
>
> Systems with a lower C1 latency will be found in the states table by
> the menu governor, which will pick those states as appropriate.

With this change, I believe the poll state will be selected more often 
(not too much certainly), hence implying a bigger energy consumption.

And finally it may improve the situation for specific processor but 
deteriorate for other processors.

Does anyone have the rational behind this '5' number ? why not '3' or '7' ?

> 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 22e4463d1787..ecc242a586c9 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 (data->next_timer_us > 5 &&
> +	if (data->next_timer_us > 20 &&
>   	    !drv->states[CPUIDLE_DRIVER_STATE_START].disabled &&
>   		dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
>   		data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1755392AbbJ2Lyk (ORCPT <rfc822;w@1wt.eu>);
	Thu, 29 Oct 2015 07:54:40 -0400
Received: from mx1.redhat.com ([209.132.183.28]:55982 "EHLO mx1.redhat.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1751447AbbJ2Lyj (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
	Thu, 29 Oct 2015 07:54:39 -0400
Message-ID: <563208FC.4060407@redhat.com>
Date: Thu, 29 Oct 2015 07:54:36 -0400
From: Rik van Riel <riel@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
MIME-Version: 1.0
To: Daniel Lezcano <daniel.lezcano@linaro.org>, linux-kernel@vger.kernel.org
CC: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        rafael.j.wysocki@intel.com, javi.merino@arm.com,
        tuukka.tikkanen@linaro.org
Subject: Re: [PATCH 1/3] cpuidle,x86: increase forced cut-off for polling
 to 20us
References: <1446072416-13622-1-git-send-email-riel@redhat.com> <1446072416-13622-2-git-send-email-riel@redhat.com> <5631F24E.2060508@linaro.org>
In-Reply-To: <5631F24E.2060508@linaro.org>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On 10/29/2015 06:17 AM, Daniel Lezcano wrote:
> On 10/28/2015 11:46 PM, riel@redhat.com wrote:
>> From: Rik van Riel <riel@redhat.com>
>>
>> The cpuidle menu governor has a forced cut-off for polling at 5us,
>> in order to deal with firmware that gives the OS bad information
>> on cpuidle states, leading to the system spending way too much time
>> in polling.
> 
> May be I am misunderstanding your explanation but it is not how I read
> the code.
> 
> The default idle state is C1 (hlt) if no other states suits the
> constraint. If a timer is happening really soon, then set the default
> idle state to POLL if no other idle state suits the constraint.
> 
> That applies only on x86.

With the current code, the default idle state is C1 (hlt) even if
C1 does not suit the constraint.

> This is not related to break-even but exit latency.

Why would we not care about break-even for C1?

On systems where going into C1 for too-short periods wastes
power, why would we waste the power when we expect a very
short sleep?

> IMO, we should just drop this 5us and the POLL state selection in the
> menu governor as we have since a while hyper fast C1 exit. Except a few
> embedded processors where polling is not adequate.

We have hyper fast C1 exit on Nehalem and newer high performance
chips. On those chips, we will pick C1 (or deeper) when we have
an expected sleep time of just a few microseconds.

However, on Atom, and for the paravirt cpuidle driver I am
working on, C1 exit latency and target residence are higher
than the cut-off hardcoded in the menu governor.

> Furthermore, the number of times the poll state is selected vs the other
> states is negligible.

And it will continue to be with this patch, on CPUs with
hyper fast C1 exit.

Which makes me confused about what your are objecting to,
since the system should continue to be have the way you want,
with the patch applied.

-- 
All rights reversed

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1756894AbbJ2NC0 (ORCPT <rfc822;w@1wt.eu>);
	Thu, 29 Oct 2015 09:02:26 -0400
Received: from mail-wi0-f178.google.com ([209.85.212.178]:36589 "EHLO
	mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
	with ESMTP id S1751432AbbJ2NCY (ORCPT
	<rfc822;linux-kernel@vger.kernel.org>);
	Thu, 29 Oct 2015 09:02:24 -0400
Subject: Re: [PATCH 1/3] cpuidle,x86: increase forced cut-off for polling to
 20us
To: Rik van Riel <riel@redhat.com>, linux-kernel@vger.kernel.org
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
 <1446072416-13622-2-git-send-email-riel@redhat.com>
 <5631F24E.2060508@linaro.org> <563208FC.4060407@redhat.com>
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        rafael.j.wysocki@intel.com, javi.merino@arm.com,
        tuukka.tikkanen@linaro.org
From: Daniel Lezcano <daniel.lezcano@linaro.org>
Message-ID: <563218DD.302@linaro.org>
Date: Thu, 29 Oct 2015 14:02:21 +0100
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <563208FC.4060407@redhat.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On 10/29/2015 12:54 PM, Rik van Riel wrote:
> On 10/29/2015 06:17 AM, Daniel Lezcano wrote:
>> On 10/28/2015 11:46 PM, riel@redhat.com wrote:
>>> From: Rik van Riel <riel@redhat.com>
>>>
>>> The cpuidle menu governor has a forced cut-off for polling at 5us,
>>> in order to deal with firmware that gives the OS bad information
>>> on cpuidle states, leading to the system spending way too much time
>>> in polling.
>>
>> May be I am misunderstanding your explanation but it is not how I read
>> the code.
>>
>> The default idle state is C1 (hlt) if no other states suits the
>> constraint. If a timer is happening really soon, then set the default
>> idle state to POLL if no other idle state suits the constraint.
>>
>> That applies only on x86.
>
> With the current code, the default idle state is C1 (hlt) even if
> C1 does not suit the constraint.
>
>> This is not related to break-even but exit latency.
>
> Why would we not care about break-even for C1?
>
> On systems where going into C1 for too-short periods wastes
> power, why would we waste the power when we expect a very
> short sleep?
>
>> IMO, we should just drop this 5us and the POLL state selection in the
>> menu governor as we have since a while hyper fast C1 exit. Except a few
>> embedded processors where polling is not adequate.
>
> We have hyper fast C1 exit on Nehalem and newer high performance
> chips. On those chips, we will pick C1 (or deeper) when we have
> an expected sleep time of just a few microseconds.
>
> However, on Atom, and for the paravirt cpuidle driver I am
> working on, C1 exit latency and target residence are higher
> than the cut-off hardcoded in the menu governor.
>
>> Furthermore, the number of times the poll state is selected vs the other
>> states is negligible.
>
> And it will continue to be with this patch, on CPUs with
> hyper fast C1 exit.
>
> Which makes me confused about what your are objecting to,
> since the system should continue to be have the way you want,
> with the patch applied.

Ok, I don't object the correctness of your patch but the reasoning 
behind this small optimization which bring us a lot of mess in the 
cpuidle code.

As you are touching this part of the code, I take the opportunity to 
raise a discussion about it.

 From my POV, the poll state is *not* an idle state. It is like a 
vehicle burnout [1].

But it is inserted into the idle state tables using a trick with a macro 
CPUIDLE_DRIVER_STATE_START which already led us to some bugs.

So instead of falling back into the poll state under certain 
circumstances, I propose we extract this state from the idle state table 
and we let the menu governor to fail choosing a state (or not).

 From the caller, we decide what to do (poll or C1) if the idle state 
selection fails or we choose to poll *before* like what we already have 
in kernel/sched/idle.c:

in the idle loop:

if (cpu_idle_force_poll || tick_check_broadcast_expired())
	cpu_idle_poll();
else
	cpuidle_idle_call();

By this way, we:

1) factor out the idle state selection with the find_deepest_idle_state
2) remove the CPUIDLE_DRIVER_STATE_START macro
3) concentrate the optimization logic outside of a governor which will 
benefit to all architectures

Does it make sense ?

   -- Daniel

[1] https://en.wikipedia.org/wiki/Burnout_%28vehicle%29


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S964963AbbKCWFb (ORCPT <rfc822;w@1wt.eu>);
	Tue, 3 Nov 2015 17:05:31 -0500
Received: from mga14.intel.com ([192.55.52.115]:55216 "EHLO mga14.intel.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1750891AbbKCWFa (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
	Tue, 3 Nov 2015 17:05:30 -0500
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.20,240,1444719600"; 
   d="scan'208";a="677728931"
Subject: Re: [PATCH 0/3] cpuidle: small improvements & fixes for menu governor
To: riel@redhat.com, linux-kernel@vger.kernel.org
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        daniel.lezcano@linaro.org, javi.merino@arm.com,
        tuukka.tikkanen@linaro.org
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Organization: Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego
 173, 80-298 Gdansk
Message-ID: <56392FA5.5080205@intel.com>
Date: Tue, 3 Nov 2015 23:05:25 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.2.0
MIME-Version: 1.0
In-Reply-To: <1446072416-13622-1-git-send-email-riel@redhat.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On 10/28/2015 11:46 PM, riel@redhat.com wrote:
> While working on a paravirt cpuidle driver for KVM guests, I
> noticed a number of small logic errors in the menu governor
> code.
>
> These patches should get rid of some artifacts that can break
> the logic in the menu governor under certain corner cases, and
> make idle state selection work better on CPUs with long C1 exit
> latencies.
>
> I have not seen any adverse effects with them in my (quick)
> tests. As expected, they do not seem to do much on systems with
> many power states and very low C1 exit latencies and target residencies.
>

Sorry for the trouble, but can you please resend the series with CCs to 
linux-pm@vger.kernel.org?  That will make it way easier to handle for me.

Thanks,
Rafael


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S965149AbbKCWfg (ORCPT <rfc822;w@1wt.eu>);
	Tue, 3 Nov 2015 17:35:36 -0500
Received: from mx1.redhat.com ([209.132.183.28]:51364 "EHLO mx1.redhat.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S964839AbbKCWfe (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
	Tue, 3 Nov 2015 17:35:34 -0500
Subject: Re: [PATCH 0/3] cpuidle: small improvements & fixes for menu governor
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
        linux-kernel@vger.kernel.org
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
 <56392FA5.5080205@intel.com>
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        daniel.lezcano@linaro.org, javi.merino@arm.com,
        tuukka.tikkanen@linaro.org
From: Rik van Riel <riel@redhat.com>
Message-ID: <563936B4.4030308@redhat.com>
Date: Tue, 3 Nov 2015 17:35:32 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <56392FA5.5080205@intel.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On 11/03/2015 05:05 PM, Rafael J. Wysocki wrote:
> On 10/28/2015 11:46 PM, riel@redhat.com wrote:
>> While working on a paravirt cpuidle driver for KVM guests, I
>> noticed a number of small logic errors in the menu governor
>> code.
>>
>> These patches should get rid of some artifacts that can break
>> the logic in the menu governor under certain corner cases, and
>> make idle state selection work better on CPUs with long C1 exit
>> latencies.
>>
>> I have not seen any adverse effects with them in my (quick)
>> tests. As expected, they do not seem to do much on systems with
>> many power states and very low C1 exit latencies and target residencies.
>>
> 
> Sorry for the trouble, but can you please resend the series with CCs to
> linux-pm@vger.kernel.org?  That will make it way easier to handle for me.

Not a problem. Done.

What change do I need to send in to ensure that the
linux-pm mailing list shows up in get_maintainer.pl
output?

$ ./scripts/get_maintainer.pl -f drivers/cpuidle/governors/menu.c
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
(commit_signer:4/7=57%,authored:1/7=14%,added_lines:2/19=11%,removed_lines:2/28=7%)
Daniel Lezcano <daniel.lezcano@linaro.org>
(commit_signer:3/7=43%,authored:1/7=14%,added_lines:1/19=5%)
Rik van Riel <riel@redhat.com>
(commit_signer:3/7=43%,authored:3/7=43%,added_lines:5/19=26%,removed_lines:3/28=11%)
Len Brown <len.brown@intel.com>
(commit_signer:1/7=14%,authored:1/7=14%,added_lines:10/19=53%,removed_lines:15/28=54%)
"Peter Zijlstra (Intel)" <peterz@infradead.org> (commit_signer:1/7=14%)
Javi Merino <javi.merino@arm.com>
(authored:1/7=14%,added_lines:1/19=5%,removed_lines:7/28=25%)
linux-kernel@vger.kernel.org (open list)


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S965237AbbKCXDx (ORCPT <rfc822;w@1wt.eu>);
	Tue, 3 Nov 2015 18:03:53 -0500
Received: from mga09.intel.com ([134.134.136.24]:4334 "EHLO mga09.intel.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S965058AbbKCXDw (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
	Tue, 3 Nov 2015 18:03:52 -0500
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.20,240,1444719600"; 
   d="scan'208";a="811089981"
Subject: Re: [PATCH 0/3] cpuidle: small improvements & fixes for menu governor
To: Rik van Riel <riel@redhat.com>, linux-kernel@vger.kernel.org
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
 <56392FA5.5080205@intel.com> <563936B4.4030308@redhat.com>
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        daniel.lezcano@linaro.org, javi.merino@arm.com,
        tuukka.tikkanen@linaro.org
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Organization: Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego
 173, 80-298 Gdansk
Message-ID: <56393D51.6090101@intel.com>
Date: Wed, 4 Nov 2015 00:03:45 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.2.0
MIME-Version: 1.0
In-Reply-To: <563936B4.4030308@redhat.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On 11/3/2015 11:35 PM, Rik van Riel wrote:
> On 11/03/2015 05:05 PM, Rafael J. Wysocki wrote:
>> On 10/28/2015 11:46 PM, riel@redhat.com wrote:
>>> While working on a paravirt cpuidle driver for KVM guests, I
>>> noticed a number of small logic errors in the menu governor
>>> code.
>>>
>>> These patches should get rid of some artifacts that can break
>>> the logic in the menu governor under certain corner cases, and
>>> make idle state selection work better on CPUs with long C1 exit
>>> latencies.
>>>
>>> I have not seen any adverse effects with them in my (quick)
>>> tests. As expected, they do not seem to do much on systems with
>>> many power states and very low C1 exit latencies and target residencies.
>>>
>> Sorry for the trouble, but can you please resend the series with CCs to
>> linux-pm@vger.kernel.org?  That will make it way easier to handle for me.
> Not a problem. Done.
>
> What change do I need to send in to ensure that the
> linux-pm mailing list shows up in get_maintainer.pl
> output?
>
> $ ./scripts/get_maintainer.pl -f drivers/cpuidle/governors/menu.c
> "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> (commit_signer:4/7=57%,authored:1/7=14%,added_lines:2/19=11%,removed_lines:2/28=7%)
> Daniel Lezcano <daniel.lezcano@linaro.org>
> (commit_signer:3/7=43%,authored:1/7=14%,added_lines:1/19=5%)
> Rik van Riel <riel@redhat.com>
> (commit_signer:3/7=43%,authored:3/7=43%,added_lines:5/19=26%,removed_lines:3/28=11%)
> Len Brown <len.brown@intel.com>
> (commit_signer:1/7=14%,authored:1/7=14%,added_lines:10/19=53%,removed_lines:15/28=54%)
> "Peter Zijlstra (Intel)" <peterz@infradead.org> (commit_signer:1/7=14%)
> Javi Merino <javi.merino@arm.com>
> (authored:1/7=14%,added_lines:1/19=5%,removed_lines:7/28=25%)
> linux-kernel@vger.kernel.org (open list)
>

I'm not sure why it doesn't show up in there.  If you look at 
MAINTAINERS under CPUIDLE DRIVERS, linux-pm is actually listed there.

Maybe the answer is that get_maintainer.pl needs to be fixed ...

Thanks,
Rafael


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1752492AbbKDG4P (ORCPT <rfc822;w@1wt.eu>);
	Wed, 4 Nov 2015 01:56:15 -0500
Received: from smtprelay0214.hostedemail.com ([216.40.44.214]:44728 "EHLO
	smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL)
	by vger.kernel.org with ESMTP id S1751588AbbKDG4N (ORCPT
	<rfc822;linux-kernel@vger.kernel.org>);
	Wed, 4 Nov 2015 01:56:13 -0500
X-Session-Marker: 6A6F6540706572636865732E636F6D
X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:2903:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:4384:5007:6119:6261:7875:7903:9010:10004:10400:10848:11232:11657:11658:11914:12043:12295:12296:12517:12519:12555:12663:12740:13618:14096:14097:14659:21067:21080:30006:30012:30034:30045:30054:30055:30060:30064:30070:30083:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:4,LUA_SUMMARY:none
X-HE-Tag: egg23_18d6322794525
X-Filterd-Recvd-Size: 4250
Message-ID: <1446620168.21133.29.camel@perches.com>
Subject: Re: [PATCH 0/3] cpuidle: small improvements & fixes for menu
 governor
From: Joe Perches <joe@perches.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
        Rik van Riel <riel@redhat.com>, linux-kernel@vger.kernel.org
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        daniel.lezcano@linaro.org, javi.merino@arm.com,
        tuukka.tikkanen@linaro.org
Date: Tue, 03 Nov 2015 22:56:08 -0800
In-Reply-To: <56393D51.6090101@intel.com>
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
	 <56392FA5.5080205@intel.com> <563936B4.4030308@redhat.com>
	 <56393D51.6090101@intel.com>
Content-Type: text/plain; charset="ISO-8859-1"
X-Mailer: Evolution 3.16.5-1ubuntu3 
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On Wed, 2015-11-04 at 00:03 +0100, Rafael J. Wysocki wrote:
> On 11/3/2015 11:35 PM, Rik van Riel wrote:
> > On 11/03/2015 05:05 PM, Rafael J. Wysocki wrote:
> > > On 10/28/2015 11:46 PM, riel@redhat.com wrote:
> > > > While working on a paravirt cpuidle driver for KVM guests, I
> > > > noticed a number of small logic errors in the menu governor
> > > > code.
> > > > 
> > > > These patches should get rid of some artifacts that can break
> > > > the logic in the menu governor under certain corner cases, and
> > > > make idle state selection work better on CPUs with long C1 exit
> > > > latencies.
> > > > 
> > > > I have not seen any adverse effects with them in my (quick)
> > > > tests. As expected, they do not seem to do much on systems with
> > > > many power states and very low C1 exit latencies and target
> > > > residencies.
> > > > 
> > > Sorry for the trouble, but can you please resend the series with
> > > CCs to
> > > linux-pm@vger.kernel.org?  That will make it way easier to handle
> > > for me.
> > Not a problem. Done.
> > 
> > What change do I need to send in to ensure that the
> > linux-pm mailing list shows up in get_maintainer.pl
> > output?
> > 
> > $ ./scripts/get_maintainer.pl -f drivers/cpuidle/governors/menu.c
> > "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> > (commit_signer:4/7=57%,authored:1/7=14%,added_lines:2/19=11%,remove
> > d_lines:2/28=7%)
> > Daniel Lezcano <daniel.lezcano@linaro.org>
> > (commit_signer:3/7=43%,authored:1/7=14%,added_lines:1/19=5%)
> > Rik van Riel <riel@redhat.com>
> > (commit_signer:3/7=43%,authored:3/7=43%,added_lines:5/19=26%,remove
> > d_lines:3/28=11%)
> > Len Brown <len.brown@intel.com>
> > (commit_signer:1/7=14%,authored:1/7=14%,added_lines:10/19=53%,remov
> > ed_lines:15/28=54%)
> > "Peter Zijlstra (Intel)" <peterz@infradead.org>
> > (commit_signer:1/7=14%)
> > Javi Merino <javi.merino@arm.com>
> > (authored:1/7=14%,added_lines:1/19=5%,removed_lines:7/28=25%)
> > linux-kernel@vger.kernel.org (open list)
> > 
> 
> I'm not sure why it doesn't show up in there.
> If you look at MAINTAINERS under CPUIDLE DRIVERS, linux-pm is
> actually listed there.

Because the pattern is just the files in the top level directory
of drivers/cpuidle and not any files in any directory below

>>From the MAINTAINERS pattern descriptions:

	F: Files and directories with wildcard patterns.
	   A trailing slash includes all files and subdirectory files.
	   F:	drivers/net/	all files in and below
drivers/net
	   F:	drivers/net/*	all files in drivers/net, but
not below

> Maybe the answer is that get_maintainer.pl needs to be fixed ...

Nope, the MAINTAINERS - CPUIDLE DRIVERS entry does though.

---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 77ed3a0..8bd5c7e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3004,7 +3004,7 @@ M:	Daniel Lezcano <daniel.lezcano@linaro.org>
 L:	linux-pm@vger.kernel.org
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
-F:	drivers/cpuidle/*
+F:	drivers/cpuidle/
 F:	include/linux/cpuidle.h
 
 CPUID/MSR DRIVER


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S965506AbbKDODQ (ORCPT <rfc822;w@1wt.eu>);
	Wed, 4 Nov 2015 09:03:16 -0500
Received: from mga14.intel.com ([192.55.52.115]:46606 "EHLO mga14.intel.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S965184AbbKDODP (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
	Wed, 4 Nov 2015 09:03:15 -0500
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.20,243,1444719600"; 
   d="scan'208";a="593886021"
Subject: Re: [PATCH 0/3] cpuidle: small improvements & fixes for menu governor
To: Joe Perches <joe@perches.com>, Rik van Riel <riel@redhat.com>,
        linux-kernel@vger.kernel.org
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
 <56392FA5.5080205@intel.com> <563936B4.4030308@redhat.com>
 <56393D51.6090101@intel.com> <1446620168.21133.29.camel@perches.com>
Cc: arjan@linux.intel.com, khilman@ti.com, len.brown@intel.com,
        daniel.lezcano@linaro.org, javi.merino@arm.com,
        tuukka.tikkanen@linaro.org
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Organization: Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego
 173, 80-298 Gdansk
Message-ID: <563A0FF3.40604@intel.com>
Date: Wed, 4 Nov 2015 15:02:27 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <1446620168.21133.29.camel@perches.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On 11/4/2015 7:56 AM, Joe Perches wrote:
> On Wed, 2015-11-04 at 00:03 +0100, Rafael J. Wysocki wrote:
>> On 11/3/2015 11:35 PM, Rik van Riel wrote:
>>> On 11/03/2015 05:05 PM, Rafael J. Wysocki wrote:
>>>> On 10/28/2015 11:46 PM, riel@redhat.com wrote:
>>>>> While working on a paravirt cpuidle driver for KVM guests, I
>>>>> noticed a number of small logic errors in the menu governor
>>>>> code.
>>>>>
>>>>> These patches should get rid of some artifacts that can break
>>>>> the logic in the menu governor under certain corner cases, and
>>>>> make idle state selection work better on CPUs with long C1 exit
>>>>> latencies.
>>>>>
>>>>> I have not seen any adverse effects with them in my (quick)
>>>>> tests. As expected, they do not seem to do much on systems with
>>>>> many power states and very low C1 exit latencies and target
>>>>> residencies.
>>>>>
>>>> Sorry for the trouble, but can you please resend the series with
>>>> CCs to
>>>> linux-pm@vger.kernel.org?  That will make it way easier to handle
>>>> for me.
>>> Not a problem. Done.
>>>
>>> What change do I need to send in to ensure that the
>>> linux-pm mailing list shows up in get_maintainer.pl
>>> output?
>>>
>>> $ ./scripts/get_maintainer.pl -f drivers/cpuidle/governors/menu.c
>>> "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
>>> (commit_signer:4/7=57%,authored:1/7=14%,added_lines:2/19=11%,remove
>>> d_lines:2/28=7%)
>>> Daniel Lezcano <daniel.lezcano@linaro.org>
>>> (commit_signer:3/7=43%,authored:1/7=14%,added_lines:1/19=5%)
>>> Rik van Riel <riel@redhat.com>
>>> (commit_signer:3/7=43%,authored:3/7=43%,added_lines:5/19=26%,remove
>>> d_lines:3/28=11%)
>>> Len Brown <len.brown@intel.com>
>>> (commit_signer:1/7=14%,authored:1/7=14%,added_lines:10/19=53%,remov
>>> ed_lines:15/28=54%)
>>> "Peter Zijlstra (Intel)" <peterz@infradead.org>
>>> (commit_signer:1/7=14%)
>>> Javi Merino <javi.merino@arm.com>
>>> (authored:1/7=14%,added_lines:1/19=5%,removed_lines:7/28=25%)
>>> linux-kernel@vger.kernel.org (open list)
>>>
>> I'm not sure why it doesn't show up in there.
>> If you look at MAINTAINERS under CPUIDLE DRIVERS, linux-pm is
>> actually listed there.
> Because the pattern is just the files in the top level directory
> of drivers/cpuidle and not any files in any directory below
>
>  From the MAINTAINERS pattern descriptions:
>
> 	F: Files and directories with wildcard patterns.
> 	   A trailing slash includes all files and subdirectory files.
> 	   F:	drivers/net/	all files in and below
> drivers/net
> 	   F:	drivers/net/*	all files in drivers/net, but
> not below
>
>> Maybe the answer is that get_maintainer.pl needs to be fixed ...
> Nope, the MAINTAINERS - CPUIDLE DRIVERS entry does though.

OK, I see.

Care to send this patch with a proper changelog/sign-off?

> ---
>   MAINTAINERS | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 77ed3a0..8bd5c7e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3004,7 +3004,7 @@ M:	Daniel Lezcano <daniel.lezcano@linaro.org>
>   L:	linux-pm@vger.kernel.org
>   S:	Maintained
>   T:	git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
> -F:	drivers/cpuidle/*
> +F:	drivers/cpuidle/
>   F:	include/linux/cpuidle.h
>   
>   CPUID/MSR DRIVER
>


From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <linux-kernel-owner@vger.kernel.org>
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1030426AbbKDP4a (ORCPT <rfc822;w@1wt.eu>);
	Wed, 4 Nov 2015 10:56:30 -0500
Received: from smtprelay0242.hostedemail.com ([216.40.44.242]:36344 "EHLO
	smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL)
	by vger.kernel.org with ESMTP id S1751443AbbKDP43 (ORCPT
	<rfc822;linux-kernel@vger.kernel.org>);
	Wed, 4 Nov 2015 10:56:29 -0500
X-Session-Marker: 6A6F6540706572636865732E636F6D
X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:800:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:2903:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6119:6261:7903:9010:10004:10400:10848:11232:11658:11914:12295:12296:12517:12519:12660:12663:12740:13069:13311:13357:13618:14659:21080:30022:30054:30056:30060:30064:30070:30083:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none
X-HE-Tag: sort43_5569117bfce23
X-Filterd-Recvd-Size: 2394
Message-ID: <1446652585.21133.45.camel@perches.com>
Subject: Re: [PATCH 0/3] cpuidle: small improvements & fixes for menu
 governor
From: Joe Perches <joe@perches.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
        Rik van Riel <riel@redhat.com>, linux-kernel@vger.kernel.org
Cc: arjan@linux.intel.com, khilman@kernel.org, len.brown@intel.com,
        daniel.lezcano@linaro.org, javi.merino@arm.com
Date: Wed, 04 Nov 2015 07:56:25 -0800
In-Reply-To: <563A0FF3.40604@intel.com>
References: <1446072416-13622-1-git-send-email-riel@redhat.com>
	 <56392FA5.5080205@intel.com> <563936B4.4030308@redhat.com>
	 <56393D51.6090101@intel.com> <1446620168.21133.29.camel@perches.com>
	 <563A0FF3.40604@intel.com>
Content-Type: text/plain; charset="ISO-8859-1"
X-Mailer: Evolution 3.16.5-1ubuntu3 
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Sender: linux-kernel-owner@vger.kernel.org
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org

On Wed, 2015-11-04 at 15:02 +0100, Rafael J. Wysocki wrote:
> On 11/4/2015 7:56 AM, Joe Perches wrote:
> > On Wed, 2015-11-04 at 00:03 +0100, Rafael J. Wysocki wrote:
> > > On 11/3/2015 11:35 PM, Rik van Riel wrote:
> > > > On 11/03/2015 05:05 PM, Rafael J. Wysocki wrote:
> > > > > On 10/28/2015 11:46 PM, riel@redhat.com wrote:
[]
> > > > > Sorry for the trouble, but can you please resend the series
> > > > > with
> > > > > CCs to
> > > > > linux-pm@vger.kernel.org?  That will make it way easier to
> > > > > handle
> > > > > for me.
> > > > Not a problem. Done.
> > > > 
> > > > What change do I need to send in to ensure that the
> > > > linux-pm mailing list shows up in get_maintainer.pl output?
[]
> > > I'm not sure why it doesn't show up in there.
[]
> > > If you look at MAINTAINERS under CPUIDLE DRIVERS, linux-pm is
> > > actually listed there.
> > Because the pattern is just the files in the top level directory
> > of drivers/cpuidle and not any files in any directory below
> Care to send this patch with a proper changelog/sign-off?

Sending patches with my current version of the
evolution email client (3.16.5) is a bit troublesome.

I'm going to either upgrade to 3.19, downgrade back
to 3.12 or change clients altogether.

Can you do it instead please?


