cpupower : Fix cpupower working when cpu0 is offline
authorAbhishek Goel <huntbag@linux.vnet.ibm.com>
Wed, 15 Nov 2017 08:40:02 +0000 (14:10 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2018 16:05:35 +0000 (17:05 +0100)
commitd8f75b4c7f259307ab9d0f4f304476e2b701c6ef
tree08e255c3ab825b7ff18afd97a32616817783269b
parent82e57cdce058713d3546f525140599c3b9b339fb
cpupower : Fix cpupower working when cpu0 is offline

[ Upstream commit dbdc468f35ee827cab2753caa1c660bdb832243a ]

cpuidle_monitor used to assume that cpu0 is always online which is not
a valid assumption on POWER machines. This patch fixes this by getting
the cpu on which the current thread is running, instead of always using
cpu0 for monitoring which may not be online.

Signed-off-by: Abhishek Goel <huntbag@linux.vnet.ibm.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c