linux/arch/powerpc
Paul Mackerras 37d8182838 perf_counter: add an mmap method to allow userspace to read hardware counters
Impact: new feature giving performance improvement

This adds the ability for userspace to do an mmap on a hardware counter
fd and get access to a read-only page that contains the information
needed to translate a hardware counter value to the full 64-bit
counter value that would be returned by a read on the fd.  This is
useful on architectures that allow user programs to read the hardware
counters, such as PowerPC.

The mmap will only succeed if the counter is a hardware counter
monitoring the current process.

On my quad 2.5GHz PowerPC 970MP machine, userspace can read a counter
and translate it to the full 64-bit value in about 30ns using the
mmapped page, compared to about 830ns for the read syscall on the
counter, so this does give a significant performance improvement.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Orig-LKML-Reference: <20090323172417.297057964@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-06 09:30:26 +02:00
..
boot powerpc/83xx: add mmc-spi support via the device tree for MPC8323E-RDB 2009-04-01 08:59:23 -07:00
configs powerpc/85xx: Add support for the "socrates" board (MPC8544). 2009-03-27 06:42:08 -05:00
include/asm perf_counter: abstract wakeup flag setting in core to fix powerpc build 2009-04-06 09:30:14 +02:00
kernel perf_counter: add an mmap method to allow userspace to read hardware counters 2009-04-06 09:30:26 +02:00
kvm KVM: ppc: e500: Fix the bug that KVM is unstable in SMP 2009-03-24 11:03:15 +02:00
lib Merge commit 'origin/master' into next 2009-03-11 17:10:07 +11:00
math-emu powerpc/math-emu: Fix efp dependence 2009-03-11 06:00:08 -05:00
mm perf_counter: provide major/minor page fault software events 2009-04-06 09:29:40 +02:00
oprofile powerpc/oprofile: G4 oprofile has variable number of counters 2009-03-11 17:10:16 +11:00
platforms Merge branch 'linus' into perfcounters/core-v2 2009-04-06 09:02:57 +02:00
sysdev Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-04-03 15:24:35 -07:00
xmon powerpc: Prepare xmon_save_regs for use with kdump 2008-12-23 15:13:28 +11:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-04-03 15:24:35 -07:00
Kconfig.debug generic debug pagealloc: build fix 2009-04-02 19:04:48 -07:00
Makefile powerpc/math-emu: Fix efp dependence 2009-03-11 06:00:08 -05:00