diff options
author | Boris Ostrovsky <boris.ostrovsky@amd.com> | 2012-06-06 16:34:53 +0100 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@amd.com> | 2012-06-06 16:34:53 +0100 |
commit | db48465811a8d983a349d7b8a96c16f6adf942dc (patch) | |
tree | 4bf04732ef38011c3013bc4684dcd4643041a7f9 /xen/include/xen/cpuidle.h | |
parent | bf3ffa30a023fed127fa5cfc0d52f6844e244561 (diff) | |
download | xen-db48465811a8d983a349d7b8a96c16f6adf942dc.tar.gz xen-db48465811a8d983a349d7b8a96c16f6adf942dc.tar.bz2 xen-db48465811a8d983a349d7b8a96c16f6adf942dc.zip |
xenpm, x86: Fix reporting of idle state average residency times
If CPU stays in the same idle state for the full duration of
xenpm sample then average residency may not be reported correctly
since usage counter will not be incremented.
In addition, in order to calculate averages correctly residence
time and usage counter should be read and written atomically.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xen/cpuidle.h')
-rw-r--r-- | xen/include/xen/cpuidle.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xen/include/xen/cpuidle.h b/xen/include/xen/cpuidle.h index a5d11899a3..0e2bcd07c3 100644 --- a/xen/include/xen/cpuidle.h +++ b/xen/include/xen/cpuidle.h @@ -28,6 +28,7 @@ #define _XEN_CPUIDLE_H #include <xen/cpumask.h> +#include <xen/spinlock.h> #define ACPI_PROCESSOR_MAX_POWER 8 #define CPUIDLE_NAME_LEN 16 @@ -69,6 +70,7 @@ struct acpi_processor_power void *gdata; /* governor specific data */ u32 last_residency; u32 count; + spinlock_t stat_lock; struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; }; |