From: Peter Zijlstra <peterz@infradead.org>
To: "Woodhouse, David" <dwmw@amazon.co.uk>
Cc: "Sieber, Fernand" <sieberf@amazon.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"seanjc@google.com" <seanjc@google.com>,
"Saenz Julienne, Nicolas" <nsaenz@amazon.es>,
"Busse, Anselm" <abusse@amazon.de>,
"x86@kernel.org" <x86@kernel.org>, "bp@alien8.de" <bp@alien8.de>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"Schönherr, Jan H." <jschoenh@amazon.de>,
"Borghorst, Hendrik" <hborghor@amazon.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"nh-open-source@amazon.com" <nh-open-source@amazon.com>
Subject: Re: [PATCH] KVM: x86/pmu: Do not accidentally create BTS events
Date: Tue, 2 Dec 2025 10:35:34 +0100 [thread overview]
Message-ID: <20251202093534.GA2458571@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <0ce1757e3267df037912b303f60c662c45d0a6e6.camel@amazon.co.uk>
On Mon, Dec 01, 2025 at 02:45:01PM +0000, Woodhouse, David wrote:
> On Mon, 2025-12-01 at 16:23 +0200, Fernand Sieber wrote
> > Perf considers the combination of PERF_COUNT_HW_BRANCH_INSTRUCTIONS with
> > a sample_period of 1 a special case and handles this as a BTS event (see
> > intel_pmu_has_bts_period()) -- a deviation from the usual semantic,
> > where the sample_period represents the amount of branch instructions to
> > encounter before the overflow handler is invoked.
>
> That's kind of awful, and seems to be the real underlying cause of the KVM
> issue. Can we kill it with fire? Peter?
Well, IIRC it gives the same information and was actually less expensive
to run, seeing how BTS can buffer the data rather than having to take an
interrupt on every event.
But its been ages since this was done.
Now arguably it should not be done for this kvm stuff, because the
data-store buffers don't virtualize (just like old PEBS).
next prev parent reply other threads:[~2025-12-02 9:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 14:23 [PATCH] KVM: x86/pmu: Do not accidentally create BTS events Fernand Sieber
2025-12-01 14:26 ` kernel test robot
2025-12-01 14:45 ` Woodhouse, David
2025-12-02 9:35 ` Peter Zijlstra [this message]
2025-12-02 9:59 ` Fernand Sieber
2025-12-02 10:03 ` Peter Zijlstra
2025-12-02 12:44 ` Peter Zijlstra
2025-12-02 16:03 ` Sean Christopherson
2025-12-10 10:11 ` Fernand Sieber
2025-12-10 11:16 ` Peter Zijlstra
2025-12-11 18:36 ` [PATCH v2] perf/x86/intel: Do not enable BTS for guests Fernand Sieber
2025-12-11 18:38 ` kernel test robot
2026-01-14 17:25 ` David Woodhouse
2026-01-21 13:57 ` Fernand Sieber
2026-01-21 15:31 ` Peter Zijlstra
2026-01-21 15:50 ` [tip: perf/urgent] " tip-bot2 for Fernand Sieber
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=20251202093534.GA2458571@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=abusse@amazon.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dwmw@amazon.co.uk \
--cc=hborghor@amazon.de \
--cc=hpa@zytor.com \
--cc=jschoenh@amazon.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nh-open-source@amazon.com \
--cc=nsaenz@amazon.es \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=sieberf@amazon.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@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