Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
"These fix two intel_pstate issues related to the way it works when the
scaling_governor sysfs attribute is set to "performance" and fix up
messages in the system suspend core code.

Specifics:

- Fix a missing KERN_CONT in a system suspend message by converting
the affected code to using pr_info() and pr_cont() instead of the
"raw" printk() (Jon Hunter).

- Make intel_pstate set the CPU P-state from its .set_policy()
callback when the scaling_governor sysfs attribute is set to
"performance" so that it interacts with NOHZ_FULL more predictably
which was the case before 4.7 (Rafael Wysocki).

- Make intel_pstate always request the maximum allowed P-state when
the scaling_governor sysfs attribute is set to "performance" to
prevent it from effectively ingoring that setting is some
situations (Rafael Wysocki)"

* tag 'pm-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: intel_pstate: Always set max P-state in performance mode
PM / suspend: Fix missing KERN_CONT for suspend message
cpufreq: intel_pstate: Set P-state upfront in performance mode

+34 -8
+32 -6
drivers/cpufreq/intel_pstate.c
··· 179 179 /** 180 180 * struct cpudata - Per CPU instance data storage 181 181 * @cpu: CPU number for this instance data 182 + * @policy: CPUFreq policy value 182 183 * @update_util: CPUFreq utility callback information 183 184 * @update_util_set: CPUFreq utility callback is set 184 185 * @iowait_boost: iowait-related boost fraction ··· 202 201 struct cpudata { 203 202 int cpu; 204 203 204 + unsigned int policy; 205 205 struct update_util_data update_util; 206 206 bool update_util_set; 207 207 ··· 1144 1142 *min = clamp_t(int, min_perf, cpu->pstate.min_pstate, max_perf); 1145 1143 } 1146 1144 1147 - static void intel_pstate_set_min_pstate(struct cpudata *cpu) 1145 + static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) 1148 1146 { 1149 - int pstate = cpu->pstate.min_pstate; 1150 - 1151 1147 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); 1152 1148 cpu->pstate.current_pstate = pstate; 1153 1149 /* ··· 1155 1155 */ 1156 1156 wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, 1157 1157 pstate_funcs.get_val(cpu, pstate)); 1158 + } 1159 + 1160 + static void intel_pstate_set_min_pstate(struct cpudata *cpu) 1161 + { 1162 + intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); 1163 + } 1164 + 1165 + static void intel_pstate_max_within_limits(struct cpudata *cpu) 1166 + { 1167 + int min_pstate, max_pstate; 1168 + 1169 + update_turbo_state(); 1170 + intel_pstate_get_min_max(cpu, &min_pstate, &max_pstate); 1171 + intel_pstate_set_pstate(cpu, max_pstate); 1158 1172 } 1159 1173 1160 1174 static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) ··· 1339 1325 1340 1326 from = cpu->pstate.current_pstate; 1341 1327 1342 - target_pstate = pstate_funcs.get_target_pstate(cpu); 1328 + target_pstate = cpu->policy == CPUFREQ_POLICY_PERFORMANCE ? 1329 + cpu->pstate.turbo_pstate : pstate_funcs.get_target_pstate(cpu); 1343 1330 1344 1331 intel_pstate_update_pstate(cpu, target_pstate); 1345 1332 ··· 1506 1491 pr_debug("set_policy cpuinfo.max %u policy->max %u\n", 1507 1492 policy->cpuinfo.max_freq, policy->max); 1508 1493 1509 - cpu = all_cpu_data[0]; 1494 + cpu = all_cpu_data[policy->cpu]; 1495 + cpu->policy = policy->policy; 1496 + 1510 1497 if (cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && 1511 1498 policy->max < policy->cpuinfo.max_freq && 1512 1499 policy->max > cpu->pstate.max_pstate * cpu->pstate.scaling) { ··· 1516 1499 policy->max = policy->cpuinfo.max_freq; 1517 1500 } 1518 1501 1519 - if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) { 1502 + if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { 1520 1503 limits = &performance_limits; 1521 1504 if (policy->max >= policy->cpuinfo.max_freq) { 1522 1505 pr_debug("set performance\n"); ··· 1552 1535 limits->max_perf = round_up(limits->max_perf, FRAC_BITS); 1553 1536 1554 1537 out: 1538 + if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { 1539 + /* 1540 + * NOHZ_FULL CPUs need this as the governor callback may not 1541 + * be invoked on them. 1542 + */ 1543 + intel_pstate_clear_update_util_hook(policy->cpu); 1544 + intel_pstate_max_within_limits(cpu); 1545 + } 1546 + 1555 1547 intel_pstate_set_update_util_hook(policy->cpu); 1556 1548 1557 1549 intel_pstate_hwp_set_policy(policy);
+2 -2
kernel/power/suspend.c
··· 498 498 499 499 #ifndef CONFIG_SUSPEND_SKIP_SYNC 500 500 trace_suspend_resume(TPS("sync_filesystems"), 0, true); 501 - printk(KERN_INFO "PM: Syncing filesystems ... "); 501 + pr_info("PM: Syncing filesystems ... "); 502 502 sys_sync(); 503 - printk("done.\n"); 503 + pr_cont("done.\n"); 504 504 trace_suspend_resume(TPS("sync_filesystems"), 0, false); 505 505 #endif 506 506