]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.53/powerpc-powernv-cpuidle-init-all-present-cpus-for-deep-states.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.53 / powerpc-powernv-cpuidle-init-all-present-cpus-for-deep-states.patch
1 From ac9816dcbab53c57bcf1d7b15370b08f1e284318 Mon Sep 17 00:00:00 2001
2 From: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
3 Date: Wed, 16 May 2018 17:32:14 +0530
4 Subject: powerpc/powernv/cpuidle: Init all present cpus for deep states
5
6 From: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
7
8 commit ac9816dcbab53c57bcf1d7b15370b08f1e284318 upstream.
9
10 Init all present cpus for deep states instead of "all possible" cpus.
11 Init fails if a possible cpu is guarded. Resulting in making only
12 non-deep states available for cpuidle/hotplug.
13
14 Stewart says, this means that for single threaded workloads, if you
15 guard out a CPU core you'll not get WoF (Workload Optimised
16 Frequency), which means that performance goes down when you wouldn't
17 expect it to.
18
19 Fixes: 77b54e9f213f ("powernv/powerpc: Add winkle support for offline cpus")
20 Cc: stable@vger.kernel.org # v3.19+
21 Signed-off-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
22 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25 ---
26 arch/powerpc/platforms/powernv/idle.c | 4 ++--
27 1 file changed, 2 insertions(+), 2 deletions(-)
28
29 --- a/arch/powerpc/platforms/powernv/idle.c
30 +++ b/arch/powerpc/platforms/powernv/idle.c
31 @@ -78,7 +78,7 @@ static int pnv_save_sprs_for_deep_states
32 uint64_t msr_val = MSR_IDLE;
33 uint64_t psscr_val = pnv_deepest_stop_psscr_val;
34
35 - for_each_possible_cpu(cpu) {
36 + for_each_present_cpu(cpu) {
37 uint64_t pir = get_hard_smp_processor_id(cpu);
38 uint64_t hsprg0_val = (uint64_t)&paca[cpu];
39
40 @@ -741,7 +741,7 @@ static int __init pnv_init_idle_states(v
41 int cpu;
42
43 pr_info("powernv: idle: Saving PACA pointers of all CPUs in their thread sibling PACA\n");
44 - for_each_possible_cpu(cpu) {
45 + for_each_present_cpu(cpu) {
46 int base_cpu = cpu_first_thread_sibling(cpu);
47 int idx = cpu_thread_in_core(cpu);
48 int i;