All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Doug Smythies" <dsmythies@telus.net>
To: "'Rafael J. Wysocki'" <rjw@rjwysocki.net>
Cc: 'Andy Tang' <andy.tang@nxp.com>,
	"'Rafael J. Wysocki'" <rafael@kernel.org>,
	'Linux PM' <linux-pm@vger.kernel.org>,
	'Viresh Kumar' <viresh.kumar@linaro.org>,
	'Stratos Karafotis' <stratosk@semaphore.gr>,
	Doug Smythies <dsmythies@telus.net>
Subject: RE: Ask for help on governor
Date: Fri, 15 Dec 2017 10:27:12 -0800	[thread overview]
Message-ID: <002501d375d2$54f942c0$feebc840$@net> (raw)
In-Reply-To: PsJoe2WoyTqmMPsJueuzun

On 2017.12.15 07:54 Rafael J. Wysocki wrote:
> On Friday, December 15, 2017 8:37:38 AM Doug Smythies wrote:
>
>> Could you please try the below reversion patch.
>> It is on top of kernel 4.15-rc3.
>> 
>> On my system, and for the intel_cpufrequ scaling driver,
>> the default sampling_rate goes back to 20000 (which works)
>> from 500 uSec (which doesn't), for both the conservative
>> and ondemand governors.
>
> OK
> 
> So AFAICS the problem is that dbs_update() makes assumptions that are not
> me, quite obviously, if the sampling interval is less than the tick period.
>
> For example, the "time_elapsed > 2 * sampling_rate" condition in it may
> very well trigger every time in that case and that obviously affects the
> conservative governor.

It does trigger every time and that is why the conservative gov. sticks at
low frequency.

> What about the patch below, then?

I am testing now, from previous work, and already reported on this thread,
I already know that the conservative governor will be O.K..
It will take me awhile to thoroughly test the ondemand governor. At only 1.0
ticks at best it will be quite noisy and more sensitive to work/sleep frequencies
for periodic workflows.

By the way, I modified your proposed patch, which needed to divide by
NSEC_PER_USEC instead of multiply by.
i.e. I am testing this:

diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 58d4f4e..1c2fd1d 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -430,7 +430,14 @@ int cpufreq_dbs_governor_init(struct cpufreq_policy *policy)
        if (ret)
                goto free_policy_dbs_info;

+       /*
+        * The sampling interval should not be greater than the transition
+        * latency of the CPU, but it also cannot be less than the tick period
+        * for dbs_update() to work correctly.
+        */
        dbs_data->sampling_rate = cpufreq_policy_transition_delay_us(policy);
+       if (dbs_data->sampling_rate < TICK_NSEC / NSEC_PER_USEC)
+               dbs_data->sampling_rate = TICK_NSEC / NSEC_PER_USEC;

        if (!have_governor_per_policy())
                gov->gdbs_data = dbs_data;

... Doug

  parent reply	other threads:[~2017-12-15 18:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <HE1PR0402MB282866171A847AE244A9F76CF3340@HE1PR0402MB2828.eurprd04.prod.outlook.com>
2017-12-12  7:30 ` Ask for help on governor Viresh Kumar
2017-12-12 16:18 ` Doug Smythies
2017-12-12 16:51   ` Rafael J. Wysocki
2017-12-13  3:10   ` Doug Smythies
2017-12-13  6:17     ` Viresh Kumar
2017-12-13  6:22       ` Andy Tang
2017-12-13  6:55         ` Viresh Kumar
2017-12-13 16:13       ` Doug Smythies
2017-12-14  1:21       ` Doug Smythies
2017-12-14  2:42         ` Andy Tang
2017-12-14 18:25           ` Stratos Karafotis
2017-12-15  1:29           ` Doug Smythies
2017-12-15  1:30         ` Doug Smythies
2017-12-15  1:56           ` Andy Tang
2017-12-15  7:37           ` Doug Smythies
2017-12-15  9:00             ` Andy Tang
2017-12-15 14:26               ` Rafael J. Wysocki
2017-12-15 15:53             ` Rafael J. Wysocki
2017-12-15 18:27             ` Doug Smythies [this message]
2017-12-15 23:53               ` Rafael J. Wysocki
2017-12-18  1:15               ` [PATCH] cpufreq: governor: Ensure sufficiently large sampling intervals Rafael J. Wysocki
2017-12-18  2:59                 ` Andy Tang
2017-12-18  4:38                 ` Viresh Kumar
2017-12-18 16:11               ` Doug Smythies
2017-12-18 17:42                 ` Rafael J. Wysocki
2017-12-13 16:13     ` Ask for help on governor Doug Smythies
2017-12-13 16:49     ` Doug Smythies

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='002501d375d2$54f942c0$feebc840$@net' \
    --to=dsmythies@telus.net \
    --cc=andy.tang@nxp.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=stratosk@semaphore.gr \
    --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 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.