From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Chander Kashyap <chander.kashyap@linaro.org>
Cc: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
rafael.j.wysocki@intel.com,
Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH] cpuidle: governor: menu: move repeated correction factor check to init
Date: Tue, 22 Apr 2014 12:03:02 +0200 [thread overview]
Message-ID: <2870361.ixyW1GZfvF@vostro.rjw.lan> (raw)
In-Reply-To: <CANuQgHFGTkT0h6_FmxRxg4kYQA2NWEuzch1pj4Ec+_XnRHV2EQ@mail.gmail.com>
On Tuesday, April 22, 2014 08:27:53 AM Chander Kashyap wrote:
> ping
Please CC cpuidle patches to linux-pm@vger.kernel.org.
Thanks!
> On 10 April 2014 19:57, Tuukka Tikkanen <tuukka.tikkanen@linaro.org> wrote:
> > On 10 April 2014 16:43, 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>
> >> ---
> >> 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 cf7f2f0..048f6d9 100644
> >> --- a/drivers/cpuidle/governors/menu.c
> >> +++ b/drivers/cpuidle/governors/menu.c
> >> @@ -315,13 +315,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
> >> multiplier = performance_multiplier();
> >>
> >> /*
> >> - * 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.
> >> @@ -453,9 +446,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;
> >> }
> >>
> >> --
> >> 1.7.9.5
> >>
> >
> > Reviewed-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
>
>
>
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2014-04-22 9:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 13:43 Chander Kashyap
2014-04-10 14:27 ` Tuukka Tikkanen
2014-04-22 2:57 ` Chander Kashyap
2014-04-22 10:03 ` Rafael J. Wysocki [this message]
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
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=2870361.ixyW1GZfvF@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=chander.kashyap@linaro.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--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®