linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Alex Shi <alex.shi@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>
Cc: linux-pm@vger.kernel.org
Subject: Re: [RFC PATCH] cpuidle: reduce unnecessary loop in c-state selection
Date: Wed, 22 Jan 2014 09:19:47 +0100	[thread overview]
Message-ID: <52DF7F23.10104@linaro.org> (raw)
In-Reply-To: <52DF78F1.7080204@linaro.org>

On 01/22/2014 08:53 AM, Alex Shi wrote:
> On 01/16/2014 11:53 PM, Rafael J. Wysocki wrote:
>> Hi Len, what do you think?
>
> Is this patch correct?

Well, there is no rule telling in what order the idle states are, except 
they are ordered by power consumption.

But regarding how are defined the different idle states in the drivers, 
I think this patch makes sense.

>>
>> On Thursday, January 16, 2014 08:45:16 PM Alex Shi wrote:
>>> All deeper c-state have the longer target_residency and exit_latency
>>> So, if the one can not meet our prediction, neither any later.
>>> So, just break out the for loop to save few checking instructions.
>>>
>>> Signed-off-by: Alex Shi <alex.shi@linaro.org>
>>> ---
>>>   drivers/cpuidle/governors/menu.c | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
>>> index cf7f2f0..48ed3fb 100644
>>> --- a/drivers/cpuidle/governors/menu.c
>>> +++ b/drivers/cpuidle/governors/menu.c
>>> @@ -352,11 +352,11 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>>>   		if (s->disabled || su->disable)
>>>   			continue;
>>>   		if (s->target_residency > data->predicted_us)
>>> -			continue;
>>> +			break;
>>>   		if (s->exit_latency > latency_req)
>>> -			continue;
>>> +			break;
>>>   		if (s->exit_latency * multiplier > data->predicted_us)
>>> -			continue;
>>> +			break;
>>>
>>>   		data->last_state_idx = i;
>>>   		data->exit_us = s->exit_latency;
>>>
>>
>
>


-- 
  <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


      reply	other threads:[~2014-01-22  8:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 12:45 [RFC PATCH] cpuidle: reduce unnecessary loop in c-state selection Alex Shi
2014-01-16 15:53 ` Rafael J. Wysocki
2014-01-22  7:53   ` Alex Shi
2014-01-22  8:19     ` Daniel Lezcano [this message]

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=52DF7F23.10104@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=alex.shi@linaro.org \
    --cc=len.brown@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).