From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
To: Chander Kashyap <chander.kashyap@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND][PATCH] cpuidle: governor: menu: move repeated correction factor check to init
Date: Fri, 16 May 2014 11:46:40 +0200 [thread overview]
Message-ID: <5375DE80.4030707@intel.com> (raw)
In-Reply-To: <CANuQgHGLgrbYME7Y8zJQ6ACt7ByviZJMMEk+RbhqwXvnsm+8_g@mail.gmail.com>
On 5/16/2014 10:16 AM, Chander Kashyap wrote:
> On 22 April 2014 18:08, Chander Kashyap <chander.kashyap@linaro.org> wrote:
>> In menu_select function we check for correction factor every time.
>> If it is zero we are initializing to unity. Hence move it to init function
>> and initialise by unity, hence avoid repeated comparisons.
>>
>> Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
>> Reviewed-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
>> ---
>> drivers/cpuidle/governors/menu.c | 15 ++++++++-------
>> 1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
>> index 71b5232..9b7918c 100644
>> --- a/drivers/cpuidle/governors/menu.c
>> +++ b/drivers/cpuidle/governors/menu.c
>> @@ -311,13 +311,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>> data->bucket = which_bucket(data->next_timer_us);
>>
>> /*
>> - * if the correction factor is 0 (eg first time init or cpu hotplug
>> - * etc), we actually want to start out with a unity factor.
>> - */
>> - if (data->correction_factor[data->bucket] == 0)
>> - data->correction_factor[data->bucket] = RESOLUTION * DECAY;
>> -
>> - /*
>> * Force the result of multiplication to be 64 bits even if both
>> * operands are 32 bits.
>> * Make sure to round up for half microseconds.
>> @@ -466,9 +459,17 @@ static int menu_enable_device(struct cpuidle_driver *drv,
>> struct cpuidle_device *dev)
>> {
>> struct menu_device *data = &per_cpu(menu_devices, dev->cpu);
>> + int i;
>>
>> memset(data, 0, sizeof(struct menu_device));
>>
>> + /*
>> + * if the correction factor is 0 (eg first time init or cpu hotplug
>> + * etc), we actually want to start out with a unity factor.
>> + */
>> + for(i = 0; i < BUCKETS; i++)
>> + data->correction_factor[i] = RESOLUTION * DECAY;
>> +
>> return 0;
>> }
>>
> ping.
I believe this is in linux-next today, care to check?
Rafael
next prev parent reply other threads:[~2014-05-16 9:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 13:43 [PATCH] " Chander Kashyap
2014-04-10 14:27 ` Tuukka Tikkanen
2014-04-22 2:57 ` Chander Kashyap
2014-04-22 10:03 ` Rafael J. Wysocki
2014-04-22 9:54 ` Chander Kashyap
2014-04-22 11:24 ` Rafael J. Wysocki
2014-04-22 12:26 ` Chander Kashyap
2014-04-22 12:38 ` [RESEND][PATCH] " Chander Kashyap
2014-05-16 8:16 ` Chander Kashyap
2014-05-16 9:46 ` Rafael J. Wysocki [this message]
2014-05-16 9:54 ` Chander Kashyap
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=5375DE80.4030707@intel.com \
--to=rafael.j.wysocki@intel.com \
--cc=chander.kashyap@linaro.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tuukka.tikkanen@linaro.org \
/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
all inboxes | Powered by JetHome®