All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: kvm list <kvm@vger.kernel.org>
Subject: Re: Non-exiting rdpmc on KVM guests?
Date: Tue, 21 Apr 2015 17:05:14 +0200	[thread overview]
Message-ID: <20150421150514.GC3182@worktop.meeting.verilan.com> (raw)
In-Reply-To: <CALCETrX59C9QunSy-u12mz=gttb8+X_57r5bkL3=XFC9Rbup_A@mail.gmail.com>

On Mon, Apr 20, 2015 at 05:47:23PM -0700, Andy Lutomirski wrote:
> I just wrote a little perf self-monitoring tool that uses rdpmc to
> count cycles.  Performance sucks under KVM (VMX).
> 
> How hard would it be to avoid rdpmc exits in cases where the host and
> guest pmu configurations are compatible as seen by rdpmc?  I'm mostly
> ignorant of how the PMU counter offsets and such work.

I'm not sure how all the VMX stuff works. how is rdpmc seem? It it at
all possible to not trap that?

But as it stands there is not even a hint from the emulated pmu events
on which counters they 'ought' to run so they landing the same way the
guest thinks they ought to is rather small.

'someone' would have to go look at the event scheduling and see how to
implement it, my first suggestion would be to set hwc->idx to the
desired number and hope x86_schedule_events() takes the fast path.

Of course, the moment there's host events along with the guest events
the whole thing comes tumbling down, but there's nothing much one can do
about that.



  reply	other threads:[~2015-04-21 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21  0:47 Non-exiting rdpmc on KVM guests? Andy Lutomirski
2015-04-21 15:05 ` Peter Zijlstra [this message]
2015-04-21 16:32   ` Paolo Bonzini
2015-04-21 20:51     ` Peter Zijlstra
2015-04-21 21:10       ` Andy Lutomirski
2015-04-22 15:26         ` Peter Zijlstra
2015-04-22 21:05       ` Paolo Bonzini

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=20150421150514.GC3182@worktop.meeting.verilan.com \
    --to=peterz@infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=luto@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.