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

On 01/16/2014 11:53 PM, Rafael J. Wysocki wrote:
> Hi Len, what do you think?

Is this patch correct?
> 
> 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;
>>
> 


-- 
Thanks
    Alex

  reply	other threads:[~2014-01-22  7:53 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 [this message]
2014-01-22  8:19     ` Daniel Lezcano

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=52DF78F1.7080204@linaro.org \
    --to=alex.shi@linaro.org \
    --cc=daniel.lezcano@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).