From: Avi Kivity <avi@redhat.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Subject: Re: [PATCH v1 5/5] KVM: Expose a version 1 architectural PMU to guests
Date: Wed, 18 May 2011 12:03:19 +0300 [thread overview]
Message-ID: <4DD38B57.2070904@redhat.com> (raw)
In-Reply-To: <20110517194117.GA26184@elte.hu>
On 05/17/2011 10:41 PM, Ingo Molnar wrote:
> * Avi Kivity<avi@redhat.com> wrote:
>
> > 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
>
> Hm, do you need more than perf_event::event_limit, or something special?
I do use event_limit, but it's inexact since it auto-disables the event
after firing the callback. I want to limit the callback to just one,
but let the event keep counting.
> > - some combinations of INV and CMASK are not supported
>
> Could you please describe this better, where does this limit come from?
> If perf then this needs fixing.
perf_event_attr does not support generic INV and CMASK at all. I
imagine you can get them through the model-specific hardware
configuration, but that means we have to encode model specific
information into kvm host code, which is (a) hard (b) counter to the
spirit of perf.
(INV and CMASK allow you to increment the counter only when > N or < N
events occur simultaneously, for example count when 2 or more
instructions are retired in a single clock).
> > - counters keep on counting in the host as well as the guest
>
> I suspect fixing this either needs a hw filter feature, or the ability to
> disable/enable these events across VM exits/entries.
>
> I would imagine the disable/enable to be rather expensive so hw help would be
> preferred ...
Yes, Joerg already posted support for this feature for AMD. Intel
supports this in a more complicated way (you can tell vmx to load
IA32_PERF_GLOBAL_CTL atomically during entry or exit). This can be done
independently of this patchset.
> I didnt see anything objectionable in your patches, but i'd like to have
> Peter's Acked-by as well before we go forward. I think that in the long run
> having a virtio-perf gateway would allow us a lot more tricks than just
> arch-perfmon emulation:
>
> - we could do things like propagate guest side traces over to the host
We support that already via 'perf kvm', no? This is more about the
guest profiling itself without access to the host (which is the more
common scenario, IMO).
We're still missing tunnelling guest ftrace to the host, but a patch was
recently posted to do that.
> - we could control from the host which events we measure on the guest side
>
> - etc.
>
> How would you like to handle the flow of patches - should we merge #1,#2,#3 in
> perf/core and you'd then merge #4,#5 via the KVM tree once the first bits hit
> upstream?
>
> We could also set up a separate branch for these three commits, which you could
> pull - this would allow all this to still hit .40.
You can put them in either perf/core or a different branch, and I can
pull them as long as its fast-forward only.
But I don't think I'll target 2.6.40, this needs to be tested a lot
more, particularly wrt guest-initiated DoS against the host.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-05-18 9:03 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DD38B57.2070904@redhat.com \
--to=avi@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).