linux_dsm_epyc7002/arch/powerpc/platforms/pseries
Julius Werner a474a51549 cpuidle: Measure idle state durations with monotonic clock
Many cpuidle drivers measure their time spent in an idle state by
reading the wallclock time before and after idling and calculating the
difference. This leads to erroneous results when the wallclock time gets
updated by another processor in the meantime, adding that clock
adjustment to the idle state's time counter.

If the clock adjustment was negative, the result is even worse due to an
erroneous cast from int to unsigned long long of the last_residency
variable. The negative 32 bit integer will zero-extend and result in a
forward time jump of roughly four billion milliseconds or 1.3 hours on
the idle state residency counter.

This patch changes all affected cpuidle drivers to either use the
monotonic clock for their measurements or make use of the generic time
measurement wrapper in cpuidle.c, which was already working correctly.
Some superfluous CLIs/STIs in the ACPI code are removed (interrupts
should always already be disabled before entering the idle function, and
not get reenabled until the generic wrapper has performed its second
measurement). It also removes the erroneous cast, making sure that
negative residency values are applied correctly even though they should
not appear anymore.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Tested-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-11-27 14:17:58 +01:00
..
cmm.c power: cmm - convert sysdev_class to a regular subsystem 2011-12-21 15:09:51 -08:00
dlpar.c powerpc/pseries: Avoid spurious error during hotplug CPU add 2011-09-20 09:20:00 +10:00
dtl.c Disintegrate asm/system.h for PowerPC 2012-03-28 18:30:02 +01:00
eeh_cache.c powerpc/eeh: Cleanup on EEH PCI address cache 2012-09-10 09:59:00 +10:00
eeh_dev.c powerpc/eeh: Create PEs for PHBs 2012-09-10 09:35:30 +10:00
eeh_driver.c powerpc/eeh: Lock module while handling EEH event 2012-09-18 15:32:48 +10:00
eeh_event.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-10-13 10:05:52 +09:00
eeh_pe.c powerpc/eeh: Don't release eeh_mutex in eeh_phb_pe_get 2012-09-27 12:51:07 +10:00
eeh_pseries.c powerpc/eeh: Probe mode support 2012-09-10 09:35:44 +10:00
eeh_sysfs.c powerpc/eeh: Move stats to PE 2012-09-10 09:35:43 +10:00
eeh.c powerpc/eeh: Fix crash on converting OF node to edev 2012-09-18 15:32:51 +10:00
event_sources.c powerpc/pseries: Add WARN_ON() to request_event_sources_irqs() on irq allocation/request failure 2010-07-09 11:28:32 +10:00
firmware.c powerpc: Add VPHN firmware feature 2010-11-29 15:48:22 +11:00
hotplug-cpu.c Disintegrate asm/system.h for PowerPC 2012-03-28 18:30:02 +01:00
hotplug-memory.c arch/powerpc/platforms/pseries/hotplug-memory.c: section removal cleanups 2012-10-11 08:50:14 +09:00
hvCall_inst.c powerpc: Fix unpaired probe_hcall_entry and probe_hcall_exit 2012-01-03 12:09:27 +11:00
hvCall.S powerpc: Merge STK_REG/PARAM/FRAMESIZE 2012-07-10 19:18:03 +10:00
hvconsole.c powerpc: convert hvconsole.c to export.h ; fix implicit use of errno.h 2011-10-31 19:30:43 -04:00
hvcserver.c
io_event_irq.c powerpc: Make function that parses RTAS error logs global 2012-03-28 11:31:58 +11:00
iommu.c powerpc: Remove all includes of <asm/abs_addr.h> 2012-09-05 15:19:33 +10:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-05-22 19:22:50 -07:00
kexec.c powerpc/pseries: Simplify vpa deregistration functions 2011-08-05 14:47:58 +10:00
lpar.c powerpc/mm: Convert virtual address to vpn 2012-09-17 16:31:49 +10:00
Makefile powerpc/eeh: Create PEs for PHBs 2012-09-10 09:35:30 +10:00
mobility.c of: Improve prom_update_property() function 2012-07-11 15:26:51 +10:00
msi.c powerpc/eeh: Trace error based on PE from beginning 2012-09-10 09:35:33 +10:00
nvram.c kmsg - kmsg_dump() use iterator to receive log buffer content 2012-06-15 14:53:59 -07:00
offline_states.h powerpc/smp: soft-replugged CPUs must go back to start_secondary 2011-04-01 15:37:09 +11:00
pci_dlpar.c powerpc/eeh: Remove EEH PE for normal PCI hotplug 2012-09-18 15:32:23 +10:00
pci.c powerpc/eeh: Cleanup on EEH PCI address cache 2012-09-10 09:59:00 +10:00
plpar_wrappers.h powerpc: Clean up lppaca->cede_latency_hint 2012-04-30 15:37:15 +10:00
power.c
processor_idle.c cpuidle: Measure idle state durations with monotonic clock 2012-11-27 14:17:58 +01:00
pseries_energy.c cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
pseries.h powerpc/cpuidle: cpuidle driver for pSeries 2011-12-08 13:56:31 +11:00
ras.c Disintegrate asm/system.h for PowerPC 2012-03-28 18:30:02 +01:00
reconfig.c of: Improve prom_update_property() function 2012-07-11 15:26:51 +10:00
scanlog.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
setup.c powerpc: Dynamically calculate the dabrx based on kernel/user/hypervisor 2012-09-10 09:59:13 +10:00
smp.c powerpc/pseries/cpuidle: Replace pseries_notify_cpuidle_add call with notifier 2012-07-03 14:14:40 +10:00
suspend.c powerpc/pseries: Fix partition migration hang in stop_topology_update 2012-02-14 15:01:39 +11:00