diff mbox series

[2/6] KVM: selftests: Avoid flooding debug log while populating memory

Message ID 20210112214253.463999-3-bgardon@google.com
State Accepted
Commit 89dc52946a165b5396d4b84717d36ded8c5783c7
Headers show
Series KVM: selftests: Perf test cleanups and memslot modification test | expand

Commit Message

Ben Gardon Jan. 12, 2021, 9:42 p.m. UTC
Peter Xu pointed out that a log message printed while waiting for the
memory population phase of the dirty_log_perf_test will flood the debug
logs as there is no delay after printing the message. Since the message
does not provide much value anyway, remove it.

Reviewed-by: Jacob Xu <jacobhxu@google.com>

Signed-off-by: Ben Gardon <bgardon@google.com>
---
 tools/testing/selftests/kvm/dirty_log_perf_test.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Thomas Huth Jan. 13, 2021, 7:37 a.m. UTC | #1
On 12/01/2021 22.42, Ben Gardon wrote:
> Peter Xu pointed out that a log message printed while waiting for the
> memory population phase of the dirty_log_perf_test will flood the debug
> logs as there is no delay after printing the message. Since the message
> does not provide much value anyway, remove it.
> 
> Reviewed-by: Jacob Xu <jacobhxu@google.com>
> 
> Signed-off-by: Ben Gardon <bgardon@google.com>
> ---
>   tools/testing/selftests/kvm/dirty_log_perf_test.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c
> index 16efe6589b43..15a9c45bdb5f 100644
> --- a/tools/testing/selftests/kvm/dirty_log_perf_test.c
> +++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c
> @@ -146,8 +146,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)
>   	/* Allow the vCPU to populate memory */
>   	pr_debug("Starting iteration %lu - Populating\n", iteration);
>   	while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id]) != iteration)
> -		pr_debug("Waiting for vcpu_last_completed_iteration == %lu\n",
> -			iteration);
> +		;
>   
>   	ts_diff = timespec_elapsed(start);
>   	pr_info("Populate memory time: %ld.%.9lds\n",
> @@ -171,9 +170,9 @@ static void run_test(enum vm_guest_mode mode, void *arg)
>   
>   		pr_debug("Starting iteration %lu\n", iteration);
>   		for (vcpu_id = 0; vcpu_id < nr_vcpus; vcpu_id++) {
> -			while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id]) != iteration)
> -				pr_debug("Waiting for vCPU %d vcpu_last_completed_iteration == %lu\n",
> -					 vcpu_id, iteration);
> +			while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id])
> +			       != iteration)
> +				;
>   		}
>   
>   		ts_diff = timespec_elapsed(start);
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Sean Christopherson Jan. 16, 2021, midnight UTC | #2
On Tue, Jan 12, 2021, Ben Gardon wrote:
> Peter Xu pointed out that a log message printed while waiting for the

> memory population phase of the dirty_log_perf_test will flood the debug

> logs as there is no delay after printing the message. Since the message

> does not provide much value anyway, remove it.


Does it provide value if something goes wrong?  E.g. if a vCPU doesn't finish,
how would one go about debugging?  Would it make sense to make the print
ratelimited instead of removing it altogether?
 
> Reviewed-by: Jacob Xu <jacobhxu@google.com>

> 

> Signed-off-by: Ben Gardon <bgardon@google.com>

> ---

>  tools/testing/selftests/kvm/dirty_log_perf_test.c | 9 ++++-----

>  1 file changed, 4 insertions(+), 5 deletions(-)

> 

> diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c

> index 16efe6589b43..15a9c45bdb5f 100644

> --- a/tools/testing/selftests/kvm/dirty_log_perf_test.c

> +++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c

> @@ -146,8 +146,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)

>  	/* Allow the vCPU to populate memory */

>  	pr_debug("Starting iteration %lu - Populating\n", iteration);

>  	while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id]) != iteration)

> -		pr_debug("Waiting for vcpu_last_completed_iteration == %lu\n",

> -			iteration);

> +		;

>  

>  	ts_diff = timespec_elapsed(start);

>  	pr_info("Populate memory time: %ld.%.9lds\n",

> @@ -171,9 +170,9 @@ static void run_test(enum vm_guest_mode mode, void *arg)

>  

>  		pr_debug("Starting iteration %lu\n", iteration);

>  		for (vcpu_id = 0; vcpu_id < nr_vcpus; vcpu_id++) {

> -			while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id]) != iteration)

> -				pr_debug("Waiting for vCPU %d vcpu_last_completed_iteration == %lu\n",

> -					 vcpu_id, iteration);

> +			while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id])

> +			       != iteration)


I like the original better.  Poking out past 80 chars isn't the end of the world.

> +				;

>  		}

>  

>  		ts_diff = timespec_elapsed(start);

> -- 

> 2.30.0.284.gd98b1dd5eaa7-goog

>
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c
index 16efe6589b43..15a9c45bdb5f 100644
--- a/tools/testing/selftests/kvm/dirty_log_perf_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c
@@ -146,8 +146,7 @@  static void run_test(enum vm_guest_mode mode, void *arg)
 	/* Allow the vCPU to populate memory */
 	pr_debug("Starting iteration %lu - Populating\n", iteration);
 	while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id]) != iteration)
-		pr_debug("Waiting for vcpu_last_completed_iteration == %lu\n",
-			iteration);
+		;
 
 	ts_diff = timespec_elapsed(start);
 	pr_info("Populate memory time: %ld.%.9lds\n",
@@ -171,9 +170,9 @@  static void run_test(enum vm_guest_mode mode, void *arg)
 
 		pr_debug("Starting iteration %lu\n", iteration);
 		for (vcpu_id = 0; vcpu_id < nr_vcpus; vcpu_id++) {
-			while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id]) != iteration)
-				pr_debug("Waiting for vCPU %d vcpu_last_completed_iteration == %lu\n",
-					 vcpu_id, iteration);
+			while (READ_ONCE(vcpu_last_completed_iteration[vcpu_id])
+			       != iteration)
+				;
 		}
 
 		ts_diff = timespec_elapsed(start);