Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1330807 > unrolled thread

Re: [PATCH V4 5/7] cpufreq: governor: No need to manage state machine now

Started by"Rafael J. Wysocki" <rafael@kernel.org>
First post2016-02-10 01:40 +0100
Last post2016-02-10 06:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH V4 5/7] cpufreq: governor: No need to manage state machine now "Rafael J. Wysocki" <rafael@kernel.org> - 2016-02-10 01:40 +0100
    Re: [PATCH V4 5/7] cpufreq: governor: No need to manage state  machine now Viresh Kumar <viresh.kumar@linaro.org> - 2016-02-10 06:40 +0100

#1330807 — Re: [PATCH V4 5/7] cpufreq: governor: No need to manage state machine now

From"Rafael J. Wysocki" <rafael@kernel.org>
Date2016-02-10 01:40 +0100
SubjectRe: [PATCH V4 5/7] cpufreq: governor: No need to manage state machine now
Message-ID<r0qZ5-39o-37@gated-at.bofh.it>
On Tue, Feb 9, 2016 at 4:46 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> cpufreq core now guarantees that policy->rwsem wouldn't get dropped

"The cpufreq core ..." and "won't be dropped"

> while calling CPUFREQ_GOV_POLICY_EXIT governor event and will be kept

"while running the ->governor callback for the CPUFREQ_GOV_POLICY_EXIT
event and will be held"

> acquired until the complete sequence of governor state changes has
> finished.
>
> And so we can remove the state machine checks that were put in place
> earlier.

"This allows governor state machine checks to be dropped from multiple
functions in cpufreq_governor.c."

>
> This also means that policy_dbs->policy can be initialized while

"initialized upfront"

> policy_dbs is allocated, to move all initialization together.

"so the entire initialization of struct policy_dbs is carried out in one place."

>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> Tested-by: Juri Lelli <juri.lelli@arm.com>
> Tested-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
> ---
>  drivers/cpufreq/cpufreq_governor.c | 27 +++++----------------------
>  1 file changed, 5 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
> index 7038ada3915d..464f346815e0 100644

[cut]

> @@ -650,14 +644,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy)
>
>  static int cpufreq_governor_stop(struct cpufreq_policy *policy)
>  {
> -       struct policy_dbs_info *policy_dbs = policy->governor_data;
> -
> -       /* State should be equivalent to START */
> -       if (!policy_dbs->policy)
> -               return -EBUSY;
> -
> -       gov_cancel_work(policy_dbs);
> -       policy_dbs->policy = NULL;
> +       gov_cancel_work(policy);
>
>         return 0;
>  }

So maybe we can call gov_cancel_work(policy) from
cpufreq_governor_dbs() directly and get rid of this wrapper too?

Thanks,
Rafael

[toc] | [next] | [standalone]


#1330905 — Re: [PATCH V4 5/7] cpufreq: governor: No need to manage state machine now

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-02-10 06:40 +0100
SubjectRe: [PATCH V4 5/7] cpufreq: governor: No need to manage state machine now
Message-ID<r0vFo-6r2-3@gated-at.bofh.it>
In reply to#1330807
On 10-02-16, 01:36, Rafael J. Wysocki wrote:
> >  static int cpufreq_governor_stop(struct cpufreq_policy *policy)
> >  {
> > -       struct policy_dbs_info *policy_dbs = policy->governor_data;
> > -
> > -       /* State should be equivalent to START */
> > -       if (!policy_dbs->policy)
> > -               return -EBUSY;
> > -
> > -       gov_cancel_work(policy_dbs);
> > -       policy_dbs->policy = NULL;
> > +       gov_cancel_work(policy);
> >
> >         return 0;
> >  }
> 
> So maybe we can call gov_cancel_work(policy) from
> cpufreq_governor_dbs() directly and get rid of this wrapper too?

I thought about it, but left it for consistency. It wouldn't hurt, the
compiler will anyway make it inline I believe.

-- 
viresh

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web