From: Stratos Karafotis <stratosk@semaphore.gr>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH] cpufreq: ondemand: Change the calculation of target frequency
Date: Sat, 01 Jun 2013 19:06:23 +0300 [thread overview]
Message-ID: <51AA1BFF.20803@semaphore.gr> (raw)
In-Reply-To: <CAKohpokmn-Rf-1w2aQHMMMkMbJqxokWXm5ye3DNuc-yzzk=7pQ@mail.gmail.com>
On 06/01/2013 05:56 PM, Viresh Kumar wrote:
> On 31 May 2013 22:03, Stratos Karafotis <stratosk@semaphore.gr> wrote:
>> On 05/31/2013 11:51 AM, Viresh Kumar wrote:
>>> I believe you should have removed other users of getavg() in a separate
>>> patch and also cc'd relevant people so that you can some review comments
>>> from them.
>>
>> I will split the patch in two. If it's OK, I will keep the removal of
>> __cpufreq_driver_getavg in the original patch and move the clean up of
>> APERF/MPERF support in a second patch. I will also cc relevant people.
>
> Even removal of __cpufreq_driver_getavg() should be done in a separate
> patch, so that it can be reverted easily if required later.
Thanks, Viresh. I will do the removal of that function in a seperate patch.
Should I use a third patch for it? Or should I include it in the patch which
will remove APERF/MPERF support?
>>> "Proportional to load" means C * load, so why is "policy->max / 100" *the* right C?
>>
>> I think, finally(?) I see your point. The right C should be "policy->cpuinfo.max_freq / 100".
>
> Why are you changing it to cpuinfo.max_freq?? This is fixed once a driver is
> initialized.. but user may request a lower max freq for a governor or policy.
> Which is actually reflected in policy->max I believe.
My initial thought is to have a linear function to calculate the target freq
proportional to load: (I will use 'C' as the function's slope as Rafael used it)
freq_target = C * load
For simplicity, let's assume that load is between 0 and 1 as initially is calculated
in governor.
Ideally, for a load = 0, we should have freq_target = 0 and for load = 1,
freq_target = cpuinfo.max
So, the slope C = cpuinfo.max
I think, it's matter of definition about what policy->min and policy->max can do.
Should they change the slope C? Or only limit freq_target?
I don't think that the policy->max (or min) should affect HOW (slope C) governor
calculates freq_target but only limit the calculated result.
Maybe, we could have separate tunables to a affect the slope C.
If I'm wrong about the definition of policy->min, policy->max, I would change
the code accordingly.
> Over that why keeping following check is useful anymore?
>
> if (load_freq > od_tuners->up_threshold)
> goto max.
>
> As, if load is over 95, then even policy->max * 95 / 100 will even give almost
> the same freq.
>
I thought that too. But maybe user selects a lower value for up_threshold.
(For example, up_threshold = 60). In my opinion, we have to keep up_theshold,
to give the possibility to user to have max freq with small loads.
Thanks for your comments!
Stratos
next prev parent reply other threads:[~2013-06-01 16:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 21:07 [PATCH] cpufreq: ondemand: Change the calculation of target frequency Stratos Karafotis
2013-05-31 8:51 ` Viresh Kumar
2013-05-31 16:33 ` Stratos Karafotis
2013-06-01 12:27 ` Rafael J. Wysocki
2013-06-01 12:50 ` Stratos Karafotis
2013-06-01 14:56 ` Viresh Kumar
2013-06-01 16:06 ` Stratos Karafotis [this message]
2013-06-03 6:11 ` Viresh Kumar
2013-06-01 19:37 ` Rafael J. Wysocki
2013-06-03 6:51 ` Viresh Kumar
2013-06-03 6:55 ` Viresh Kumar
2013-06-03 10:57 ` Rafael J. Wysocki
2013-06-03 11:24 ` Viresh Kumar
2013-06-03 16:12 ` Stratos Karafotis
2013-06-03 10:32 ` Rafael J. Wysocki
2013-05-31 8:54 ` Viresh Kumar
2013-05-31 12:42 ` Rafael J. Wysocki
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=51AA1BFF.20803@semaphore.gr \
--to=stratosk@semaphore.gr \
--cc=cpufreq@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).