linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Doug Smythies" <dsmythies@telus.net>
To: "'Rafael J. Wysocki'" <rjw@rjwysocki.net>,
	"'Linux PM'" <linux-pm@vger.kernel.org>
Cc: "'Linux ACPI'" <linux-acpi@vger.kernel.org>,
	"'LKML'" <linux-kernel@vger.kernel.org>,
	"'Viresh Kumar'" <viresh.kumar@linaro.org>,
	"'Sudeep Holla'" <sudeep.holla@arm.com>,
	"'Dmitry Osipenko'" <digetx@gmail.com>
Subject: RE: [RFT][PATCH 1/3] PM: QoS: Introduce frequency QoS
Date: Tue, 19 Nov 2019 06:35:23 -0800	[thread overview]
Message-ID: <000401d59ee6$959e3da0$c0dab8e0$@net> (raw)
In-Reply-To: <000001d59d61$eb4e6670$c1eb3350$@net>

On 2019.11.17 08:13 Doug Smythies wrote:
> On 2019.11.16 23:35 Doug Smythies wrote:

>> Hi Rafael,
>>
>> Not sure, but I think it is this one that
>> causes complaining when I try to set the
>> intel_pstate driver to passive mode.
>> I started from active mode, powersave governor,
>> no HWP.
>>
>> Kernel: 5.4-rc7
>>
>> I did not go back and try previous 5.4 RCs.

After looking at the git tags for this patch,
I tried kernel 5.4-rc2, which was the closest
Kernel I had to before the patch set was added.
It worked fine, as expected.

>> I did try kernel 5.3-rc8, because I already had
>> it installed, and it worked fine.
>>
>> I use a script (for years), run as sudo:
>>
>> doug@s15:~/temp$ cat set_cpu_passive
>> #! /bin/bash
>> cat /sys/devices/system/cpu/intel_pstate/status
>> echo passive > /sys/devices/system/cpu/intel_pstate/status
>> cat /sys/devices/system/cpu/intel_pstate/status
>>
>> And I get this (very small excerpt):
>>
>> freq_qos_add_request() called for active request
>> WARNING: CPU: 1 PID: 2758 at kernel/power/qos.c:763 freq_qos_add_request+0x4c/0xa0
>> CPU: 1 PID: 2758 Comm: set_cpu_passive Not tainted 5.4.0-rc7-stock #727
>> Failed to add freq constraint for CPU0 (-22)
>>
>> freq_qos_add_request() called for active request
>> WARNING: CPU: 1 PID: 2758 at kernel/power/qos.c:763 freq_qos_add_request+0x4c/0xa0
>> CPU: 1 PID: 2758 Comm: set_cpu_passive Tainted: G        W         5.4.0-rc7-stock #727
>> Failed to add freq constraint for CPU1 (-22)

Updated summary of previous emails:
This patch or patch set breaks the after boot
ability to change CPU frequency scaling drivers.

Using a workaround of booting with
"intel_pstate=passive" seems to prevent the errors.

Changing between the intel_pstate and intel_cpufreq drivers
(i.e. between active and passive modes)
after boot, either way, causes the errors. i.e.

Failed to add freq constraint for CPU7 (-22)
(2 per CPU per attempt)

This is 100% repeatable.

> I forgot to mention, other than the error messages,
> things seems to work fine.

Correction: It is actually quite bad. Eventually,
there will be a "Segmentation fault (core dumped)",
and then even re-boot gets stuck and the only
recourse seems to be the reset button.

This is not 100% repeatable.

I did this (kernel 5.4-rc8):

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 8ab3170..24c7a6b 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2491,6 +2491,8 @@ static int intel_pstate_register_driver(struct cpufreq_driver *driver)
 {
        int ret;

+       pr_info("Intel P-state register driver .... \n");
+
        memset(&global, 0, sizeof(global));
        global.max_perf_pct = 100;

@@ -2508,6 +2510,8 @@ static int intel_pstate_register_driver(struct cpufreq_driver *driver)

 static int intel_pstate_unregister_driver(void)
 {
+       pr_info("Intel P-state unregister driver .... \n");
+
        if (hwp_active)
                return -EBUSY;

And got this (dmesg | grep -i pstate):

[    2.024876] intel_pstate: Intel P-state driver initializing
[    2.024883] intel_pstate: Intel P-state register driver ....

Attempt to change from the booted passive mode to active mode:

[  175.903031] intel_pstate: Intel P-state unregister driver ....
[  175.975543] intel_pstate: Intel P-state register driver ....
[  175.975754]  intel_pstate_register_driver+0x4b/0x90
[  175.975756]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.977728]  intel_pstate_register_driver+0x4b/0x90
[  175.977730]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.979644]  intel_pstate_register_driver+0x4b/0x90
[  175.979647]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.981424]  intel_pstate_register_driver+0x4b/0x90
[  175.981427]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.982428]  intel_pstate_register_driver+0x4b/0x90
[  175.982430]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.983127]  intel_pstate_register_driver+0x4b/0x90
[  175.983128]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.983829]  intel_pstate_register_driver+0x4b/0x90
[  175.983832]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.984434]  intel_pstate_register_driver+0x4b/0x90
[  175.984435]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.985040]  intel_pstate_register_driver+0x4b/0x90
[  175.985041]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.985598]  intel_pstate_register_driver+0x4b/0x90
[  175.985600]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.986178]  intel_pstate_register_driver+0x4b/0x90
[  175.986179]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.986721]  intel_pstate_register_driver+0x4b/0x90
[  175.986723]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.987301]  intel_pstate_register_driver+0x4b/0x90
[  175.987302]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.987828]  intel_pstate_register_driver+0x4b/0x90
[  175.987830]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.988420]  intel_pstate_register_driver+0x4b/0x90
[  175.988421]  ? intel_pstate_unregister_driver+0x31/0x40
[  175.988920]  intel_pstate_register_driver+0x4b/0x90
[  175.988921]  ? intel_pstate_unregister_driver+0x31/0x40

Sometimes I get this:

grep . /sys/devices/system/cpu/intel_pstate/*
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:42

Instead of this:

grep . /sys/devices/system/cpu/intel_pstate/*
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:42
/sys/devices/system/cpu/intel_pstate/no_turbo:0
/sys/devices/system/cpu/intel_pstate/num_pstates:23
/sys/devices/system/cpu/intel_pstate/status:active
/sys/devices/system/cpu/intel_pstate/turbo_pct:18

But do not yet know the exact way to reliably
create it.

This is as far as I got so far.

... Doug



  reply	other threads:[~2019-11-19 14:35 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 10:37 [RFT][PATCH 0/3] cpufreq / PM: QoS: Introduce frequency QoS and use it in cpufreq Rafael J. Wysocki
2019-10-16 10:41 ` [RFT][PATCH 1/3] PM: QoS: Introduce frequency QoS Rafael J. Wysocki
2019-10-17  9:41   ` Viresh Kumar
2019-10-17 14:16     ` Rafael J. Wysocki
2019-10-18  5:41       ` Viresh Kumar
2019-10-24 19:01   ` Leonard Crestez
2019-10-24 19:34     ` Leonard Crestez
2019-11-17  7:34   ` Doug Smythies
2019-11-17 16:13   ` Doug Smythies
2019-11-19 14:35     ` Doug Smythies [this message]
2019-11-19 19:17       ` Rafael J. Wysocki
2019-11-19 22:13         ` Rafael J. Wysocki
2019-11-20  6:55           ` Doug Smythies
2019-11-20  9:08             ` Rafael J. Wysocki
2019-10-16 10:47 ` [RFT][PATCH 2/3] cpufreq: Use per-policy " Rafael J. Wysocki
2019-10-16 18:01   ` Dmitry Osipenko
2019-10-17 21:29     ` Dmitry Osipenko
2019-10-18  9:29       ` Viresh Kumar
2019-10-18 15:31         ` Dmitry Osipenko
2019-10-16 10:47 ` [RFT][PATCH 3/3] PM: QoS: Drop frequency QoS types from device PM QoS Rafael J. Wysocki
2019-10-16 14:23 ` [RFT][PATCH 0/3] cpufreq / PM: QoS: Introduce frequency QoS and use it in cpufreq Sudeep Holla
2019-10-17  9:57   ` Viresh Kumar
2019-10-17  9:59     ` Sudeep Holla
2019-10-17 16:34       ` Rafael J. Wysocki
2019-10-17 16:42         ` Sudeep Holla
2019-10-18  5:44         ` Viresh Kumar
2019-10-18  8:24           ` Rafael J. Wysocki
2019-10-18  8:27             ` Viresh Kumar
2019-10-18  8:30               ` Rafael J. Wysocki
2019-10-18  9:24                 ` Viresh Kumar
2019-10-18  9:26                   ` Rafael J. Wysocki
2019-10-18  9:28                     ` Viresh Kumar
2019-10-17 17:14   ` Sudeep Holla
2019-10-17  9:46 ` Viresh Kumar

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='000401d59ee6$959e3da0$c0dab8e0$@net' \
    --to=dsmythies@telus.net \
    --cc=digetx@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@linaro.org \
    --subject='RE: [RFT][PATCH 1/3] PM: QoS: Introduce frequency QoS' \
    /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

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).