Re: [PATCH] cpufreq: intel_pstate: Set P-state upfront in performance mode
From: Srinivas Pandruvada
Date: Thu Oct 20 2016 - 14:22:57 EST
On Wed, 2016-10-19 at 02:57 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
[...]
> + if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) {
> + /*
> + Â* NOHZ_FULL CPUs need this as the governor callback
> may not
> + Â* be invoked on them.
> + Â*/
> + intel_pstate_clear_update_util_hook(policy->cpu);
> + intel_pstate_max_within_limits(cpu);
> + }
> +
Can we move this toÂintel_pstate_set_performance_limits
diff --git a/drivers/cpufreq/intel_pstate.c
b/drivers/cpufreq/intel_pstate.c
index a6ffd79..d0fd73e 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1543,6 +1543,13 @@ static void
intel_pstate_set_performance_limits(struct perf_limits *limits)
ÂÂÂÂÂÂÂÂlimits->max_sysfs_pct = 100;
ÂÂÂÂÂÂÂÂlimits->min_policy_pct = 0;
ÂÂÂÂÂÂÂÂlimits->min_sysfs_pct = 0;
+
+ÂÂÂÂÂÂÂ/*
+ÂÂÂÂÂÂÂÂ* NOHZ_FULL CPUs need this as the governor callback may not
+ÂÂÂÂÂÂÂÂ* be invoked on them.
+ÂÂÂÂÂÂÂÂ*/
+ÂÂÂÂÂÂÂintel_pstate_clear_update_util_hook(policy->cpu);
+ÂÂÂÂÂÂÂintel_pstate_max_within_limits(cpu);
Â}
Â
Âstatic int intel_pstate_set_policy(struct cpufreq_policy *policy)
@@ -1599,15 +1606,6 @@ static int intel_pstate_set_policy(struct
cpufreq_policy *policy)
ÂÂÂÂÂÂÂÂlimits->max_perf = round_up(limits->max_perf, FRAC_BITS);
Â
 out:
-ÂÂÂÂÂÂÂif (policy->policy == CPUFREQ_POLICY_PERFORMANCE) {
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ/*
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ* NOHZ_FULL CPUs need this as the governor callback
may not
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ* be invoked on them.
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*/
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂintel_pstate_clear_update_util_hook(policy->cpu);
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂintel_pstate_max_within_limits(cpu);
-ÂÂÂÂÂÂÂ}
-
ÂÂÂÂÂÂÂÂintel_pstate_set_update_util_hook(policy->cpu);
Â
ÂÂÂÂÂÂÂÂintel_pstate_hwp_set_policy(policy);
Thanks,
Srinivas