public inbox for kvmarm@lists.cs.columbia.edu
 help / color / mirror / Atom feed
From: Aman Priyadarshi <apeureka@amazon.de>
To: Marc Zyngier <maz@kernel.org>
Cc: Alexander Graf <graf@amazon.com>,
	kvmarm@lists.cs.columbia.edu, Ali Saidi <alisaidi@amazon.com>
Subject: Re: KVM: arm64: pmu: Reset sample period on overflow handling
Date: Wed, 16 Jun 2021 11:17:28 +0200	[thread overview]
Message-ID: <131663dbe335646ac952c55d6271022a42fa382f.camel@amazon.de> (raw)
In-Reply-To: <87lf7bhxcf.wl-maz@kernel.org>

Hi Marc,

On Tue, 2021-06-15 at 18:05 +0100, Marc Zyngier wrote:
> 
> Can you reproduce the issue with vanilla guest kernels? It'd be
> interesting to understand what makes it work on the guest side. Can
> you please bisect it?
> 

yes, I was able to narrow it down to the commit 0cbb058be904 ("arm64: perf:
Disable PMU while processing counter overflows"), which fixes the problem
on the guest side.

I _think_, I understand the problem now. Please correct me if I am wrong.

commit 30d97754b2d1 ("KVM: arm/arm64: Re-create event when setting counter
value") adds a new code path for perf event when counter value is set,
therefore kvm would generate more events than before. Without this change,
we have a lot less events, thus reducing the chances of guest messing
things up.

On the other side, commit 8c3252c06516 ("KVM: arm64: pmu: Reset sample
period on overflow handling") resets the sample period to the max value,
thus reducing the number of overflow events to guest to an optimal value
(note, number of interrupts actually handled by guest would remain same in
either case). Less number of overflow interrupts to the guest, reduces the
chance of guest making up for any left over overflow event that it did not
see earlier.

Thanks,
Aman Priyadarshi





Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879


_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2021-06-16 12:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 15:15 KVM: arm64: pmu: Reset sample period on overflow handling Aman Priyadarshi
2021-06-15 17:05 ` Marc Zyngier
2021-06-16  9:17   ` Aman Priyadarshi [this message]
2021-06-16 10:31     ` Marc Zyngier
2021-06-16 10:52       ` Aman Priyadarshi
2021-06-16 11:03         ` Marc Zyngier

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=131663dbe335646ac952c55d6271022a42fa382f.camel@amazon.de \
    --to=apeureka@amazon.de \
    --cc=alisaidi@amazon.com \
    --cc=graf@amazon.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=maz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox