diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-05-13 10:21:38 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-15 03:47:02 -0400 |
commit | 9e35ad388bea89f7d6f375af4c0ae98803688666 (patch) | |
tree | 9abbce9f6c9a914b1ea8d8dae82e159366030e4a /drivers | |
parent | 962bf7a66edca4d36a730a38ff8410a67f560e40 (diff) |
perf_counter: Rework the perf counter disable/enable
The current disable/enable mechanism is:
token = hw_perf_save_disable();
...
/* do bits */
...
hw_perf_restore(token);
This works well, provided that the use nests properly. Except we don't.
x86 NMI/INT throttling has non-nested use of this, breaking things. Therefore
provide a reference counter disable/enable interface, where the first disable
disables the hardware, and the last enable enables the hardware again.
[ Impact: refactor, simplify the PMU disable/enable logic ]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/processor_idle.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index d2830f39d46b..9645758c0472 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -763,11 +763,9 @@ static int acpi_idle_bm_check(void) | |||
763 | */ | 763 | */ |
764 | static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) | 764 | static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) |
765 | { | 765 | { |
766 | u64 perf_flags; | ||
767 | |||
768 | /* Don't trace irqs off for idle */ | 766 | /* Don't trace irqs off for idle */ |
769 | stop_critical_timings(); | 767 | stop_critical_timings(); |
770 | perf_flags = hw_perf_save_disable(); | 768 | perf_disable(); |
771 | if (cx->entry_method == ACPI_CSTATE_FFH) { | 769 | if (cx->entry_method == ACPI_CSTATE_FFH) { |
772 | /* Call into architectural FFH based C-state */ | 770 | /* Call into architectural FFH based C-state */ |
773 | acpi_processor_ffh_cstate_enter(cx); | 771 | acpi_processor_ffh_cstate_enter(cx); |
@@ -782,7 +780,7 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) | |||
782 | gets asserted in time to freeze execution properly. */ | 780 | gets asserted in time to freeze execution properly. */ |
783 | unused = inl(acpi_gbl_FADT.xpm_timer_block.address); | 781 | unused = inl(acpi_gbl_FADT.xpm_timer_block.address); |
784 | } | 782 | } |
785 | hw_perf_restore(perf_flags); | 783 | perf_enable(); |
786 | start_critical_timings(); | 784 | start_critical_timings(); |
787 | } | 785 | } |
788 | 786 | ||