perf_counter, x86: rework pmc_amd_save_disable_all() and pmc_amd_restore_all()
authorRobert Richter <robert.richter@amd.com>
Wed, 29 Apr 2009 10:47:01 +0000 (12:47 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 29 Apr 2009 12:51:02 +0000 (14:51 +0200)
commit4295ee62660b13ddb87d41539f49b239e6e7d56f
treebdd7c1b1c1b4c1c4b05d42d4837c6fbf8ad5e5f8
parent4138960a9251a265002b5cf07e671a49f8495381
perf_counter, x86: rework pmc_amd_save_disable_all() and pmc_amd_restore_all()

MSR reads and writes are expensive. This patch adds checks to avoid
its usage where possible.

[ Impact: micro-optimization on AMD CPUs ]

Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: Paul Mackerras <paulus@samba.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1241002046-8832-5-git-send-email-robert.richter@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/perf_counter.c