# git rev-parse -q --verify 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2^{commit} 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2 already have revision, skipping fetch # git checkout -q -f -B kisskb 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2 # git clean -qxdf # < git log -1 # commit 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2 # Author: Gautham R. Shenoy # Date: Thu May 31 17:45:09 2018 +0530 # # cpuidle: powernv: Fix promotion from snooze if next state disabled # # The commit 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of # snooze to deeper idle state") introduced a timeout for the snooze idle # state so that it could be eventually be promoted to a deeper idle # state. The snooze timeout value is static and set to the target # residency of the next idle state, which would train the cpuidle # governor to pick the next idle state eventually. # # The unfortunate side-effect of this is that if the next idle state(s) # is disabled, the CPU will forever remain in snooze, despite the fact # that the system is completely idle, and other deeper idle states are # available. # # This patch fixes the issue by dynamically setting the snooze timeout # to the target residency of the next enabled state on the device. # # Before Patch: # POWER8 : Only nap disabled. # $ cpupower monitor sleep 30 # sleep took 30.01297 seconds and exited with status 0 # |Idle_Stats # PKG |CORE|CPU | snoo | Nap | Fast # 0| 8| 0| 96.41| 0.00| 0.00 # 0| 8| 1| 96.43| 0.00| 0.00 # 0| 8| 2| 96.47| 0.00| 0.00 # 0| 8| 3| 96.35| 0.00| 0.00 # 0| 8| 4| 96.37| 0.00| 0.00 # 0| 8| 5| 96.37| 0.00| 0.00 # 0| 8| 6| 96.47| 0.00| 0.00 # 0| 8| 7| 96.47| 0.00| 0.00 # # POWER9: Shallow states (stop0lite, stop1lite, stop2lite, stop0, stop1, # stop2) disabled: # $ cpupower monitor sleep 30 # sleep took 30.05033 seconds and exited with status 0 # |Idle_Stats # PKG |CORE|CPU | snoo | stop | stop | stop | stop | stop | stop | stop | stop # 0| 16| 0| 89.79| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00 # 0| 16| 1| 90.12| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00 # 0| 16| 2| 90.21| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00 # 0| 16| 3| 90.29| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00 # # After Patch: # POWER8 : Only nap disabled. # $ cpupower monitor sleep 30 # sleep took 30.01200 seconds and exited with status 0 # |Idle_Stats # PKG |CORE|CPU | snoo | Nap | Fast # 0| 8| 0| 16.58| 0.00| 77.21 # 0| 8| 1| 18.42| 0.00| 75.38 # 0| 8| 2| 4.70| 0.00| 94.09 # 0| 8| 3| 17.06| 0.00| 81.73 # 0| 8| 4| 3.06| 0.00| 95.73 # 0| 8| 5| 7.00| 0.00| 96.80 # 0| 8| 6| 1.00| 0.00| 98.79 # 0| 8| 7| 5.62| 0.00| 94.17 # # POWER9: Shallow states (stop0lite, stop1lite, stop2lite, stop0, stop1, # stop2) disabled: # # $ cpupower monitor sleep 30 # sleep took 30.02110 seconds and exited with status 0 # |Idle_Stats # PKG |CORE|CPU | snoo | stop | stop | stop | stop | stop | stop | stop | stop # 0| 0| 0| 0.69| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 9.39| 89.70 # 0| 0| 1| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.05| 93.21 # 0| 0| 2| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 89.93 # 0| 0| 3| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 93.26 # # Fixes: 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state") # Cc: stable@vger.kernel.org # v4.2+ # Signed-off-by: Gautham R. Shenoy # Reviewed-by: Balbir Singh # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-gcc --version # < git log --format=%s --max-count=1 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2 # < make -s -j 48 ARCH=sh O=/kisskb/build/powerpc-next_sh-defconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- defconfig # make -s -j 48 ARCH=sh O=/kisskb/build/powerpc-next_sh-defconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- Generating include/generated/machtypes.h :1317:2: warning: #warning syscall pkey_mprotect not implemented [-Wcpp] :1320:2: warning: #warning syscall pkey_alloc not implemented [-Wcpp] :1323:2: warning: #warning syscall pkey_free not implemented [-Wcpp] :1326:2: warning: #warning syscall statx not implemented [-Wcpp] /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S: Assembler messages: /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S:389: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S:392: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/kernel/cgroup/cgroup-v1.c: In function 'cgroup1_mount': /kisskb/src/kernel/cgroup/cgroup-v1.c:1268:20: warning: 'root' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/ext4/readpage.c: In function 'ext4_mpage_readpages': /kisskb/src/fs/ext4/readpage.c:294:1: warning: the frame size of 1200 bytes is larger than 1024 bytes [-Wframe-larger-than=] /kisskb/src/kernel/rcu/srcutree.c: In function 'init_srcu_struct_fields': /kisskb/src/kernel/rcu/srcutree.c:146:32: warning: 'levelspread[]' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c:94:6: note: 'levelspread[]' was declared here /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:183:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2497:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1819:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:340:21: note: 'pdeo' was declared here /kisskb/src/mm/vmstat.c: In function 'sysctl_vm_numa_stat_handler': /kisskb/src/mm/vmstat.c:89:5: warning: 'oldval' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/sh/clk/cpg.c: In function 'r8': /kisskb/src/drivers/sh/clk/cpg.c:41:2: warning: passing argument 1 of 'ioread8' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:29:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/sh/clk/cpg.c: In function 'r16': /kisskb/src/drivers/sh/clk/cpg.c:46:2: warning: passing argument 1 of 'ioread16' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:30:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/sh/clk/cpg.c: In function 'r32': /kisskb/src/drivers/sh/clk/cpg.c:51:2: warning: passing argument 1 of 'ioread32' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:32:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/fs/mpage.c: In function 'do_mpage_readpage': /kisskb/src/fs/mpage.c:316:1: warning: the frame size of 1088 bytes is larger than 1024 bytes [-Wframe-larger-than=] /kisskb/src/fs/mpage.c: In function '__mpage_writepage': /kisskb/src/fs/mpage.c:676:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1433:5: warning: 'page' may be used uninitialized in this function [-Wuninitialized] Kernel: arch/sh/boot/zImage is ready Completed OK # rm -rf /kisskb/build/powerpc-next_sh-defconfig_sh4 # Build took: 0:00:42.366100