public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: selftests: memslot_perf_test: increase guest sync timeout
@ 2024-10-04 22:01 Maxim Levitsky
  2024-10-07 14:02 ` Liam Merwick
  2024-10-09 14:58 ` Sean Christopherson
  0 siblings, 2 replies; 4+ messages in thread
From: Maxim Levitsky @ 2024-10-04 22:01 UTC (permalink / raw)
  To: kvm
  Cc: Paolo Bonzini, linux-kselftest, Shuah Khan, linux-kernel,
	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.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 tools/testing/selftests/kvm/memslot_perf_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index 893366982f77b..e9189cbed4bb6 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -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))
-- 
2.26.3


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

* Re: [PATCH] KVM: selftests: memslot_perf_test: increase guest sync timeout
  2024-10-04 22:01 [PATCH] KVM: selftests: memslot_perf_test: increase guest sync timeout Maxim Levitsky
@ 2024-10-07 14:02 ` Liam Merwick
  2024-10-09 14:58 ` Sean Christopherson
  1 sibling, 0 replies; 4+ messages in thread
From: Liam Merwick @ 2024-10-07 14:02 UTC (permalink / raw)
  To: Maxim Levitsky, kvm@vger.kernel.org
  Cc: Paolo Bonzini, linux-kselftest@vger.kernel.org, Shuah Khan,
	linux-kernel@vger.kernel.org, Liam Merwick

On 04/10/2024 23:01, Maxim Levitsky wrote:
> 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.
> 
> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>

I see the issue without this fix.

Tested-by: Liam Merwick <liam.merwick@oracle.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>


> ---
>   tools/testing/selftests/kvm/memslot_perf_test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
> index 893366982f77b..e9189cbed4bb6 100644
> --- a/tools/testing/selftests/kvm/memslot_perf_test.c
> +++ b/tools/testing/selftests/kvm/memslot_perf_test.c
> @@ -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))


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

* Re: [PATCH] KVM: selftests: memslot_perf_test: increase guest sync timeout
  2024-10-04 22:01 [PATCH] KVM: selftests: memslot_perf_test: increase guest sync timeout Maxim Levitsky
  2024-10-07 14:02 ` Liam Merwick
@ 2024-10-09 14:58 ` Sean Christopherson
  2024-11-05  5:55   ` Sean Christopherson
  1 sibling, 1 reply; 4+ messages in thread
From: Sean Christopherson @ 2024-10-09 14:58 UTC (permalink / raw)
  To: Sean Christopherson, kvm, Maxim Levitsky
  Cc: Paolo Bonzini, linux-kselftest, Shuah Khan, linux-kernel

On Fri, 04 Oct 2024 18:01:53 -0400, Maxim Levitsky wrote:
> 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

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

* Re: [PATCH] KVM: selftests: memslot_perf_test: increase guest sync timeout
  2024-10-09 14:58 ` Sean Christopherson
@ 2024-11-05  5:55   ` Sean Christopherson
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2024-11-05  5:55 UTC (permalink / raw)
  To: kvm, Maxim Levitsky
  Cc: Paolo Bonzini, linux-kselftest, Shuah Khan, linux-kernel

On Wed, Oct 09, 2024, Sean Christopherson wrote:
> On Fri, 04 Oct 2024 18:01:53 -0400, Maxim Levitsky wrote:
> > 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

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.

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

end of thread, other threads:[~2024-11-05  5:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 22:01 [PATCH] KVM: selftests: memslot_perf_test: increase guest sync timeout Maxim Levitsky
2024-10-07 14:02 ` Liam Merwick
2024-10-09 14:58 ` Sean Christopherson
2024-11-05  5:55   ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox