From: Andi Kleen <ak@linux.intel.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: ggherdovich@suse.cz, linux-kernel@vger.kernel.org,
peterz@infradead.org, rafael.j.wysocki@intel.com, x86@kernel.org
Subject: Re: [PATCH] x86/aperfmperf: Don't disable scheduler APERF/MPERF on bad samples
Date: Thu, 4 Dec 2025 13:16:35 -0800 [thread overview]
Message-ID: <aTH6M8mU1Ods0F4t@tassilo> (raw)
In-Reply-To: <bce05954-1189-486a-965c-ea23943365f4@citrix.com>
On Thu, Dec 04, 2025 at 08:02:09PM +0000, Andrew Cooper wrote:
> > However this can happen without any malfunction when there is
> > a long enough interruption between the two MSR reads, for
> > example due to an unlucky NMI or SMI or other system event
> > causing delays.
>
> The list of problems is even longer under virt. The vCPU can lose it's
> timeslice (-> arbitrary delay), or be scheduled onto a different CPU
> between the A and M reads (-> calculate the wrong ratio, and not in a
> way you could exclude it as a bad sample).
You could avoid that in the hypervisor by saving/restoring the counts (the
MSRs are writable), but it's likely rare and harmless enough that
it's not worth the performance overhead.
-Andi
next prev parent reply other threads:[~2025-12-04 21:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-04 18:09 [PATCH] x86/aperfmperf: Don't disable scheduler APERF/MPERF on bad samples Andi Kleen
2025-12-04 20:02 ` Andrew Cooper
2025-12-04 21:16 ` Andi Kleen [this message]
2025-12-04 22:37 ` kernel test robot
2025-12-05 16:10 ` Peter Zijlstra
2025-12-07 20:38 ` Andi Kleen
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=aTH6M8mU1Ods0F4t@tassilo \
--to=ak@linux.intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=ggherdovich@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--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