linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: dsmythies@telus.net
Cc: kristen@linux.intel.com, linux-kernel@vger.kernel.org,
	viresh.kumar@linaro.org, linux-pm@vger.kernel.org,
	rjw@rjwysocki.net, Prarit Bhargava <prarit@redhat.com>
Subject: RE: [PATCH] cpufreq, intel_pstate, set max_sysfs_pct and min_sysfs_pct on governor switch
Date: Wed,  7 Oct 2015 10:34:12 -0400	[thread overview]
Message-ID: <1444228452-23726-1-git-send-email-prarit@redhat.com> (raw)
In-Reply-To: <000001d10109$10d34630$3279d290$@net>

Doug, please apply and test.

My result is:

\# initial load of driver, set to PERFORMANCE governor by default.

[   21.406525] intel_pstate_set_policy[1001] min_perf_pct = 100
[   21.421288] intel_pstate_set_policy[1001] min_perf_pct = 100
[   21.436038] intel_pstate_set_policy[1001] min_perf_pct = 100
[   21.450505] intel_pstate_set_policy[1001] min_perf_pct = 100

\#  echo 100 > /sys/devices/system/cpu/intel_pstate/min_perf_pct

[   21.483436] store_min_perf_pct[453] min_sysfs_pct = 100
[   21.489373] store_min_perf_pct[456] min_perf_pct = 100
[   21.495203] store_min_perf_pct[459] min_perf_pct = 100
[   21.501050] store_min_perf_pct[462] min_perf_pct = 100

\#  cpupower -c all frequency-set -g powersave

[  214.187212] intel_pstate_set_policy[1023] min_perf_pct = 100
[  214.193643] intel_pstate_set_policy[1028] min_perf_pct = 100
[  214.200205] intel_pstate_set_policy[1020] min_perf_pct = 100
[  214.206626] intel_pstate_set_policy[1023] min_perf_pct = 100
[  214.213064] intel_pstate_set_policy[1028] min_perf_pct = 100
[  214.219601] intel_pstate_set_policy[1020] min_perf_pct = 100
[  214.226008] intel_pstate_set_policy[1023] min_perf_pct = 100
[  214.232471] intel_pstate_set_policy[1028] min_perf_pct = 100
[  214.238990] intel_pstate_set_policy[1020] min_perf_pct = 100
[  214.245408] intel_pstate_set_policy[1023] min_perf_pct = 100
[  214.251845] intel_pstate_set_policy[1028] min_perf_pct = 100

\#  cat /sys/devices/system/cpu/intel_pstate/*_perf_pct

100
100

Thanks!

P.
---
 drivers/cpufreq/intel_pstate.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 3af9dd7..95f6b9f 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -450,9 +450,17 @@ static ssize_t store_min_perf_pct(struct kobject *a, struct attribute *b,
 		return -EINVAL;
 
 	limits.min_sysfs_pct = clamp_t(int, input, 0 , 100);
+	printk("%s[%d] min_sysfs_pct = %d\n", __FUNCTION__, __LINE__,
+	       limits.min_sysfs_pct);
 	limits.min_perf_pct = max(limits.min_policy_pct, limits.min_sysfs_pct);
+	printk("%s[%d] min_perf_pct = %d\n", __FUNCTION__, __LINE__,
+	       limits.min_perf_pct);
 	limits.min_perf_pct = min(limits.max_policy_pct, limits.min_perf_pct);
+	printk("%s[%d] min_perf_pct = %d\n", __FUNCTION__, __LINE__,
+	       limits.min_perf_pct);
 	limits.min_perf_pct = min(limits.max_perf_pct, limits.min_perf_pct);
+	printk("%s[%d] min_perf_pct = %d\n", __FUNCTION__, __LINE__,
+	       limits.min_perf_pct);
 	limits.min_perf = div_fp(int_tofp(limits.min_perf_pct), int_tofp(100));
 
 	if (hwp_active)
@@ -990,6 +998,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
 	    policy->max >= policy->cpuinfo.max_freq) {
 		limits.min_policy_pct = 100;
 		limits.min_perf_pct = 100;
+		printk("%s[%d] min_perf_pct = %d\n", __FUNCTION__, __LINE__,
+		       limits.min_perf_pct);
 		limits.min_perf = int_tofp(1);
 		limits.max_policy_pct = 100;
 		limits.max_perf_pct = 100;
@@ -1007,10 +1017,16 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
 	limits.min_perf_pct = max(limits.min_policy_pct, limits.min_sysfs_pct);
 	limits.min_perf_pct = min(limits.max_policy_pct, limits.min_perf_pct);
 	limits.max_perf_pct = min(limits.max_policy_pct, limits.max_sysfs_pct);
+	printk("%s[%d] min_perf_pct = %d\n", __FUNCTION__, __LINE__,
+	       limits.min_perf_pct);
 	limits.max_perf_pct = max(limits.min_policy_pct, limits.max_perf_pct);
+	printk("%s[%d] min_perf_pct = %d\n", __FUNCTION__, __LINE__,
+	       limits.min_perf_pct);
 
 	/* Make sure min_perf_pct <= max_perf_pct */
 	limits.min_perf_pct = min(limits.max_perf_pct, limits.min_perf_pct);
+	printk("%s[%d] min_perf_pct = %d\n", __FUNCTION__, __LINE__,
+	       limits.min_perf_pct);
 
 	limits.min_perf = div_fp(int_tofp(limits.min_perf_pct), int_tofp(100));
 	limits.max_perf = div_fp(int_tofp(limits.max_perf_pct), int_tofp(100));
-- 
1.8.3.1


  parent reply	other threads:[~2015-10-07 14:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 21:49 [PATCH] cpufreq, intel_pstate, set max_sysfs_pct and min_sysfs_pct on governor switch Prarit Bhargava
2015-10-06 22:43 ` Rafael J. Wysocki
2015-10-06 23:06   ` Rafael J. Wysocki
2015-10-07  6:51     ` Doug Smythies
2015-10-07  9:59       ` Prarit Bhargava
2015-10-07 14:04         ` Doug Smythies
2015-10-07 14:10           ` Prarit Bhargava
2015-10-07 15:40             ` Doug Smythies
2015-10-07 15:46               ` Prarit Bhargava
2015-10-07 18:52                 ` Doug Smythies
2015-10-07 20:40                   ` Prarit Bhargava
2015-10-07 21:31                   ` Prarit Bhargava
2015-10-07 22:05                     ` Rafael J. Wysocki
2015-10-07 22:26                       ` Doug Smythies
2015-10-07 23:17                         ` Prarit Bhargava
2015-10-08  0:13                         ` Prarit Bhargava
2015-10-07 23:08                       ` Prarit Bhargava
2015-10-07 14:34           ` Prarit Bhargava [this message]
2015-10-07 11:38     ` Prarit Bhargava
2015-10-07 12:18     ` Prarit Bhargava
2015-10-07 14:50       ` Prarit Bhargava

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=1444228452-23726-1-git-send-email-prarit@redhat.com \
    --to=prarit@redhat.com \
    --cc=dsmythies@telus.net \
    --cc=kristen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --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).