linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] KVM: selftests: pmu_counters_test: increase robustness of LLC cache misses
@ 2024-06-21 20:43 Maxim Levitsky
  2024-06-21 20:43 ` [PATCH 1/1] " Maxim Levitsky
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Levitsky @ 2024-06-21 20:43 UTC (permalink / raw)
  To: kvm
  Cc: Paolo Bonzini, linux-kselftest, Shuah Khan, linux-kernel,
	Sean Christopherson, Maxim Levitsky

Recent CI failures brought my attention to the fact that pmu_counters_test
sometimes fails because it doesn't get any LLC cache misses.

It apparently happens because CLFLUSH can race with CPU prediction.

To attempt to fix this, implement a more aggressive cache flushing - now it is flushed
on each iteration of the measured loop which should at least reduce by order
of magnitude the chance of this happening.

This patch survived more that a day of running in a loop on a Comet Lake machine,
where the test used to fail after about 10-20 minites.

Best regards,
	Maxim Levitsky

Maxim Levitsky (1):
  KVM: selftests: pmu_counters_test: increase robustness of LLC cache
    misses

 .../selftests/kvm/x86_64/pmu_counters_test.c  | 20 +++++++++----------
 1 file changed, 9 insertions(+), 11 deletions(-)

-- 
2.26.3



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-05  2:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-21 20:43 [PATCH 0/1] KVM: selftests: pmu_counters_test: increase robustness of LLC cache misses Maxim Levitsky
2024-06-21 20:43 ` [PATCH 1/1] " Maxim Levitsky
2024-06-26 16:08   ` Maxim Levitsky
2024-06-27 17:42   ` Sean Christopherson
2024-07-05  2:48     ` Maxim Levitsky

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).