Skip to contentSkip to conversation

KVM: selftests: memslot_perf_test: increase guest sync timeout

PATCH Applied Maxim Levitsky 3 participants 4 messages Oct 4, 2024 – Nov 5, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: selftests: memslot_perf_test: increase guest sync timeout

When memslot_perf_test is run nested, first iteration of test_memslot_rw_loop testcase, sometimes takes more than 2 seconds due to build of shadow page tables.

Following iterations are fast.

To be on the safe side, bump the timeout to 10 seconds.

---
 tools/testing/selftests/kvm/memslot_perf_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kvm/memslot_perf_test.c +1 -1
index 893366982f77b..e9189cbed4bb6 100644
@@ -415,7 +415,7 @@ static bool _guest_should_exit(void)
  */
 static noinline void host_perform_sync(struct sync_area *sync)
 {
-	alarm(2);
+	alarm(10);
 
 	atomic_store_explicit(&sync->sync_flag, true, memory_order_release);
 	while (atomic_load_explicit(&sync->sync_flag, memory_order_acquire))
Signature · 1 line
2.26.3
Tested-by Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Maxim Levitsky

When memslot_perf_test is run nested, first iteration of test_memslot_rw_loop testcase, sometimes takes more than 2 seconds due to build of shadow page tables.

Following iterations are fast.

To be on the safe side, bump the timeout to 10 seconds.

I see the issue without this fix.

Quoted 17 lines
---
  tools/testing/selftests/kvm/memslot_perf_test.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kvm/memslot_perf_test.c +1 -1
index 893366982f77b..e9189cbed4bb6 100644
@@ -415,7 +415,7 @@ static bool _guest_should_exit(void)
   */
  static noinline void host_perform_sync(struct sync_area *sync)
  {
-	alarm(2);
+	alarm(10);
 
  	atomic_store_explicit(&sync->sync_flag, true, memory_order_release);
  	while (atomic_load_explicit(&sync->sync_flag, memory_order_acquire))
reviewer Applied
#2 lore raw
In reply to Maxim Levitsky
Quoted 8 lines · Maxim Levitsky

When memslot_perf_test is run nested, first iteration of test_memslot_rw_loop testcase, sometimes takes more than 2 seconds due to build of shadow page tables.

Following iterations are fast.

To be on the safe side, bump the timeout to 10 seconds.

[...]

Nice timing (lol), the alarm can also fire spuriously when running selftests on a loaded arm64 host.

Applied to kvm-x86 fixes, thanks!

[1/1] KVM: selftests: memslot_perf_test: increase guest sync timeout

      https://github.com/kvm-x86/linux/commit/7d4e28327d7e

--
https://github.com/kvm-x86/linux/tree/next

#3 lore raw
Quoted 10 lines · Sean Christopherson
Quoted 8 lines · Maxim Levitsky

When memslot_perf_test is run nested, first iteration of test_memslot_rw_loop testcase, sometimes takes more than 2 seconds due to build of shadow page tables.

Following iterations are fast.

To be on the safe side, bump the timeout to 10 seconds.

[...]

Quoted 7 lines

Nice timing (lol), the alarm can also fire spuriously when running selftests on a loaded arm64 host.

Applied to kvm-x86 fixes, thanks!

[1/1] KVM: selftests: memslot_perf_test: increase guest sync timeout

      https://github.com/kvm-x86/linux/commit/7d4e28327d7e

FYI, I rebased "fixes" onto 6.12-rc5 to avoid conflicts in other patches, new hash:

[1/1] KVM: selftests: memslot_perf_test: increase guest sync timeout

      https://github.com/kvm-x86/linux/commit/2d0f2a648147

FWIW, I am planning on getting this to Paolo in time for -rc7.