All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Pankaj Vinodrao Joshi <Pankaj.VJ@exaleapsemi.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: cpu governor and cpufreq
Date: Thu, 22 Apr 2021 10:52:43 +0530	[thread overview]
Message-ID: <20210422052243.6a3i6gwgys57pvuc@vireshk-i7> (raw)
In-Reply-To: <BMXPR01MB287059E28B26332A636573ECEE479@BMXPR01MB2870.INDPRD01.PROD.OUTLOOK.COM>

On 21-04-21, 12:03, Pankaj  Vinodrao Joshi wrote:
> Hi,
> 
> i am trying to explore linux power management and was going through
> cpu governor and freq scaling but i have following doubts can
> someone help me to get it clarified
> 
> 1) i understood that there are different governors implemented in
>    linux kernel like ondemand, userspace etc. and each policy can
>    have different governor for each cpu ,

No. A governor controls an entire policy (policy is used to relate
CPUs, normally all CPUs belonging to a policy are controlled by a
single knob (a single bit in a register), and so they all run on the
same frequency all the time). There is a driver flag
(CPUFREQ_HAVE_GOVERNOR_PER_POLICY), which is required to allow a
different governor for each policy, without it same governor will be
used for all online CPUs.

>    but i want to understand
>    how these policies are interlinked with drivers, how they will
>    use governors ?

Policies are created (or provided by the drivers), they mainly
provide a function to change frequency (only one of target(),
target_index() or setpolicy()).

A governor is not related to a driver at all, it just tells how and
when we are going to change the frequency, and cpufreq core uses the
above callback to make that change.

> 2) which governor to use is this written in the driver code ?

Again, governor doesn't have anything to do with the driver.

> How i should verify which policy driver is using ?

All the policies are used at the same time, as each CPU needs to be
controlled by a policy..

>    i was going through
>    gpio-brcmstb.c and i was not able to see anything about cpufreq
>    scaling.

-- 
viresh

           reply	other threads:[~2021-04-22  5:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <BMXPR01MB287059E28B26332A636573ECEE479@BMXPR01MB2870.INDPRD01.PROD.OUTLOOK.COM>]

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=20210422052243.6a3i6gwgys57pvuc@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=Pankaj.VJ@exaleapsemi.com \
    --cc=linux-pm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.