diff mbox series

[v8,5/7] KVM: selftests: Shorten the test args in memslot_modification_stress_test.c

Message ID 20221102232737.1351745-6-vipinsh@google.com (mailing list archive)
State New, archived
Headers show
Series dirty_log_perf_test vCPU pinning | expand

Commit Message

Vipin Sharma Nov. 2, 2022, 11:27 p.m. UTC
Change test args memslot_modification_delay and nr_memslot_modifications
to delay and nr_iterations for simplicity.

Signed-off-by: Vipin Sharma <vipinsh@google.com>
---
 .../kvm/memslot_modification_stress_test.c     | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Sean Christopherson Nov. 2, 2022, 11:45 p.m. UTC | #1
On Wed, Nov 02, 2022, Vipin Sharma wrote:
> Change test args memslot_modification_delay and nr_memslot_modifications
> to delay and nr_iterations for simplicity.

Suggested-by: Sean Christopherson <seanjc@google.com>

I don't care about the credit so much as I don't want you getting yelled at for
one of my random ideas :-)

> Signed-off-by: Vipin Sharma <vipinsh@google.com>
> ---
>  .../kvm/memslot_modification_stress_test.c     | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> index d7ddc8a105a2..d6089ccaa484 100644
> --- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> +++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> @@ -87,8 +87,8 @@ static void add_remove_memslot(struct kvm_vm *vm, useconds_t delay,
>  }
>  
>  struct test_params {
> -	useconds_t memslot_modification_delay;
> -	uint64_t nr_memslot_modifications;
> +	useconds_t delay;
> +	uint64_t nr_iterations;
>  	bool partition_vcpu_memory_access;
>  };
>  
> @@ -107,8 +107,8 @@ static void run_test(enum vm_guest_mode mode, void *arg)
>  
>  	pr_info("Started all vCPUs\n");
>  
> -	add_remove_memslot(vm, p->memslot_modification_delay,
> -			   p->nr_memslot_modifications);
> +	add_remove_memslot(vm, p->delay,
> +			   p->nr_iterations);

This wrap is no longer necessary (which was part of the motivation for the
rename).

>  	run_vcpus = false;
>  
> @@ -144,8 +144,8 @@ int main(int argc, char *argv[])
>  	int max_vcpus = kvm_check_cap(KVM_CAP_MAX_VCPUS);
>  	int opt;
>  	struct test_params p = {
> -		.memslot_modification_delay = 0,
> -		.nr_memslot_modifications =
> +		.delay = 0,
> +		.nr_iterations =
>  			DEFAULT_MEMSLOT_MODIFICATION_ITERATIONS,
>  		.partition_vcpu_memory_access = true
>  	};
> @@ -158,8 +158,8 @@ int main(int argc, char *argv[])
>  			guest_modes_cmdline(optarg);
>  			break;
>  		case 'd':
> -			p.memslot_modification_delay = atoi_paranoid(optarg);
> -			TEST_ASSERT(p.memslot_modification_delay >= 0,
> +			p.delay = atoi_paranoid(optarg);
> +			TEST_ASSERT(p.delay >= 0,
>  				    "A negative delay is not supported.");
>  			break;
>  		case 'b':
> @@ -175,7 +175,7 @@ int main(int argc, char *argv[])
>  			p.partition_vcpu_memory_access = false;
>  			break;
>  		case 'i':
> -			p.nr_memslot_modifications = atoi_paranoid(optarg);
> +			p.nr_iterations = atoi_paranoid(optarg);
>  			break;
>  		case 'h':
>  		default:
> -- 
> 2.38.1.273.g43a17bfeac-goog
>
Sean Christopherson Nov. 3, 2022, 12:16 a.m. UTC | #2
On Wed, Nov 02, 2022, Sean Christopherson wrote:
> On Wed, Nov 02, 2022, Vipin Sharma wrote:
> > Change test args memslot_modification_delay and nr_memslot_modifications
> > to delay and nr_iterations for simplicity.
> 
> Suggested-by: Sean Christopherson <seanjc@google.com>
> 
> I don't care about the credit so much as I don't want you getting yelled at for
> one of my random ideas :-)
> 
> > Signed-off-by: Vipin Sharma <vipinsh@google.com>
> > ---
> >  .../kvm/memslot_modification_stress_test.c     | 18 +++++++++---------
> >  1 file changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> > index d7ddc8a105a2..d6089ccaa484 100644
> > --- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> > +++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> > @@ -87,8 +87,8 @@ static void add_remove_memslot(struct kvm_vm *vm, useconds_t delay,
> >  }
> >  
> >  struct test_params {
> > -	useconds_t memslot_modification_delay;
> > -	uint64_t nr_memslot_modifications;
> > +	useconds_t delay;
> > +	uint64_t nr_iterations;
> >  	bool partition_vcpu_memory_access;
> >  };
> >  
> > @@ -107,8 +107,8 @@ static void run_test(enum vm_guest_mode mode, void *arg)
> >  
> >  	pr_info("Started all vCPUs\n");
> >  
> > -	add_remove_memslot(vm, p->memslot_modification_delay,
> > -			   p->nr_memslot_modifications);
> > +	add_remove_memslot(vm, p->delay,
> > +			   p->nr_iterations);
> 
> This wrap is no longer necessary (which was part of the motivation for the
> rename).

Almost forgot.  Nit aside,

Reviewed-by: Sean Christopherson <seanjc@google.com>
Vipin Sharma Nov. 3, 2022, 6:56 p.m. UTC | #3
On Wed, Nov 2, 2022 at 5:16 PM Sean Christopherson <seanjc@google.com> wrote:
>
> On Wed, Nov 02, 2022, Sean Christopherson wrote:
> > On Wed, Nov 02, 2022, Vipin Sharma wrote:
> > > Change test args memslot_modification_delay and nr_memslot_modifications
> > > to delay and nr_iterations for simplicity.
> >
> > Suggested-by: Sean Christopherson <seanjc@google.com>
> >
> > I don't care about the credit so much as I don't want you getting yelled at for
> > one of my random ideas :-)
> >
> > > Signed-off-by: Vipin Sharma <vipinsh@google.com>
> > > ---
> > >  .../kvm/memslot_modification_stress_test.c     | 18 +++++++++---------
> > >  1 file changed, 9 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> > > index d7ddc8a105a2..d6089ccaa484 100644
> > > --- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> > > +++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
> > > @@ -87,8 +87,8 @@ static void add_remove_memslot(struct kvm_vm *vm, useconds_t delay,
> > >  }
> > >
> > >  struct test_params {
> > > -   useconds_t memslot_modification_delay;
> > > -   uint64_t nr_memslot_modifications;
> > > +   useconds_t delay;
> > > +   uint64_t nr_iterations;
> > >     bool partition_vcpu_memory_access;
> > >  };
> > >
> > > @@ -107,8 +107,8 @@ static void run_test(enum vm_guest_mode mode, void *arg)
> > >
> > >     pr_info("Started all vCPUs\n");
> > >
> > > -   add_remove_memslot(vm, p->memslot_modification_delay,
> > > -                      p->nr_memslot_modifications);
> > > +   add_remove_memslot(vm, p->delay,
> > > +                      p->nr_iterations);
> >
> > This wrap is no longer necessary (which was part of the motivation for the
> > rename).
>
> Almost forgot.  Nit aside,
>
> Reviewed-by: Sean Christopherson <seanjc@google.com>

I will update in v9.
Thanks
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
index d7ddc8a105a2..d6089ccaa484 100644
--- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
+++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
@@ -87,8 +87,8 @@  static void add_remove_memslot(struct kvm_vm *vm, useconds_t delay,
 }
 
 struct test_params {
-	useconds_t memslot_modification_delay;
-	uint64_t nr_memslot_modifications;
+	useconds_t delay;
+	uint64_t nr_iterations;
 	bool partition_vcpu_memory_access;
 };
 
@@ -107,8 +107,8 @@  static void run_test(enum vm_guest_mode mode, void *arg)
 
 	pr_info("Started all vCPUs\n");
 
-	add_remove_memslot(vm, p->memslot_modification_delay,
-			   p->nr_memslot_modifications);
+	add_remove_memslot(vm, p->delay,
+			   p->nr_iterations);
 
 	run_vcpus = false;
 
@@ -144,8 +144,8 @@  int main(int argc, char *argv[])
 	int max_vcpus = kvm_check_cap(KVM_CAP_MAX_VCPUS);
 	int opt;
 	struct test_params p = {
-		.memslot_modification_delay = 0,
-		.nr_memslot_modifications =
+		.delay = 0,
+		.nr_iterations =
 			DEFAULT_MEMSLOT_MODIFICATION_ITERATIONS,
 		.partition_vcpu_memory_access = true
 	};
@@ -158,8 +158,8 @@  int main(int argc, char *argv[])
 			guest_modes_cmdline(optarg);
 			break;
 		case 'd':
-			p.memslot_modification_delay = atoi_paranoid(optarg);
-			TEST_ASSERT(p.memslot_modification_delay >= 0,
+			p.delay = atoi_paranoid(optarg);
+			TEST_ASSERT(p.delay >= 0,
 				    "A negative delay is not supported.");
 			break;
 		case 'b':
@@ -175,7 +175,7 @@  int main(int argc, char *argv[])
 			p.partition_vcpu_memory_access = false;
 			break;
 		case 'i':
-			p.nr_memslot_modifications = atoi_paranoid(optarg);
+			p.nr_iterations = atoi_paranoid(optarg);
 			break;
 		case 'h':
 		default: