linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/5] KVM in-guest performance monitoring
@ 2011-05-11 15:55 Avi Kivity
  2011-05-11 15:55 ` [PATCH v1 1/5] perf: add context parameter to perf_event overflow handler Avi Kivity
                   ` (6 more replies)
  0 siblings, 7 replies; 40+ messages in thread
From: Avi Kivity @ 2011-05-11 15:55 UTC (permalink / raw)
  To: linux-kernel, kvm, Ingo Molnar, Peter Zijlstra,
	Arnaldo Carvalho de Melo

This not-for-merging patchset exposes an emulated version 1 architectural
performance monitoring unit to KVM guests.  The PMU is emulated using
perf_events, so the host kernel can multiplex host-wide, host-user, and the
guest on available resources.

Caveats:
- counters that have PMI (interrupt) enabled stop counting after the
  interrupt is signalled.  This is because we need one-shot samples
  that keep counting, which perf doesn't support yet
- some combinations of INV and CMASK are not supported
- counters keep on counting in the host as well as the guest
- the RDPMC instruction and CR4.PCE bit are not yet emulated
- there is likely a bug in the implementation; running 'perf top' in
  a guest that spends 80% of its time in userspace shows perf itself
  as consuming almost all cpu

perf maintainers: please consider the first three patches for merging (the
first two make sense even without the rest).  If you're familiar with the Intel
PMU, please review patch 5 as well - it effectively undoes all your work
of abstracting the PMU into perf_events by unabstracting perf_events into what
is hoped is a very similar PMU.

Avi Kivity (5):
  perf: add context parameter to perf_event overflow handler
  x86, perf: add constraints for architectural PMU v1
  perf: export perf_event_refresh() to modules
  KVM: Expose kvm_lapic_local_deliver()
  KVM: Expose a version 1 architectural PMU to guests

 arch/arm/kernel/ptrace.c                |   10 +-
 arch/powerpc/kernel/ptrace.c            |    4 +-
 arch/sh/kernel/ptrace_32.c              |    5 +-
 arch/x86/include/asm/kvm_host.h         |   29 ++++
 arch/x86/kernel/cpu/perf_event_intel.c  |   23 +++-
 arch/x86/kernel/kgdb.c                  |    2 +-
 arch/x86/kernel/ptrace.c                |    5 +-
 arch/x86/kvm/Makefile                   |    2 +-
 arch/x86/kvm/lapic.c                    |    2 +-
 arch/x86/kvm/lapic.h                    |    1 +
 arch/x86/kvm/pmu.c                      |  248 +++++++++++++++++++++++++++++++
 arch/x86/kvm/x86.c                      |   16 +-
 drivers/oprofile/oprofile_perf.c        |    5 +-
 include/linux/hw_breakpoint.h           |   10 +-
 include/linux/perf_event.h              |   13 ++-
 kernel/events/core.c                    |   27 +++-
 kernel/events/hw_breakpoint.c           |   10 +-
 kernel/watchdog.c                       |    7 +-
 samples/hw_breakpoint/data_breakpoint.c |    5 +-
 19 files changed, 377 insertions(+), 47 deletions(-)
 create mode 100644 arch/x86/kvm/pmu.c

-- 
1.7.4.3


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2011-06-05  8:13 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-11 15:55 [PATCH v1 0/5] KVM in-guest performance monitoring Avi Kivity
2011-05-11 15:55 ` [PATCH v1 1/5] perf: add context parameter to perf_event overflow handler Avi Kivity
2011-06-03 14:41   ` Peter Zijlstra
2011-06-05  8:07     ` Avi Kivity
2011-05-11 15:55 ` [PATCH v1 2/5] x86, perf: add constraints for architectural PMU v1 Avi Kivity
2011-05-11 15:55 ` [PATCH v1 3/5] perf: export perf_event_refresh() to modules Avi Kivity
2011-05-11 15:55 ` [PATCH v1 4/5] KVM: Expose kvm_lapic_local_deliver() Avi Kivity
2011-05-11 15:55 ` [PATCH v1 5/5] KVM: Expose a version 1 architectural PMU to guests Avi Kivity
2011-05-17 19:41   ` Ingo Molnar
2011-05-18  9:03     ` Avi Kivity
2011-05-18 11:07       ` Ingo Molnar
2011-05-18 11:29         ` Peter Zijlstra
2011-05-18 11:57           ` Ingo Molnar
2011-05-18 11:32         ` Peter Zijlstra
2011-05-18 11:37           ` Avi Kivity
2011-05-18 12:35             ` Peter Zijlstra
2011-05-18 12:49               ` Avi Kivity
2011-06-03 14:41   ` Peter Zijlstra
2011-06-05  8:12     ` Avi Kivity
2011-06-03 14:41   ` Peter Zijlstra
2011-06-05  8:12     ` Avi Kivity
2011-05-12  9:33 ` [PATCH v1 0/5] KVM in-guest performance monitoring Joerg Roedel
2011-05-12  9:47   ` Jan Kiszka
2011-05-12  9:53     ` Avi Kivity
2011-05-12 13:11     ` Joerg Roedel
2011-05-12 13:23       ` Jan Kiszka
2011-05-12 13:43         ` Joerg Roedel
2011-05-12 13:31       ` Avi Kivity
2011-05-12 14:24         ` Joerg Roedel
2011-05-12 14:37           ` Avi Kivity
2011-05-12 14:45             ` Avi Kivity
2011-05-13 12:34             ` Joerg Roedel
2011-05-12  9:51   ` Avi Kivity
2011-05-12 13:06     ` Joerg Roedel
2011-05-12 13:38       ` Avi Kivity
2011-05-12 14:29         ` Joerg Roedel
2011-05-17  9:52 ` Avi Kivity
2011-06-01  9:45   ` Avi Kivity
2011-06-01 10:26     ` Peter Zijlstra
2011-06-01 11:26       ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).