Skip to content

Commit a33004e

Browse files
committed
KVM: selftests: Fix inverted "warning" in access tracking perf test
Warn if the number of idle pages is greater than or equal to 10% of the total number of pages, not if the percentage of idle pages is less than 10%. The original code asserted that less than 10% of pages were still idle, but the check got inverted when the assert was converted to a warning. Opportunistically clean up the warning; selftests are 64-bit only, there is no need to use "%PRIu64" instead of "%lu". Fixes: 6336a81 ("KVM: selftests: replace assertion with warning in access_tracking_perf_test") Reviewed-by: Emanuele Giuseppe Esposito <[email protected]> Signed-off-by: Sean Christopherson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent df0bb47 commit a33004e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/testing/selftests/kvm/access_tracking_perf_test.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,9 @@ static void mark_vcpu_memory_idle(struct kvm_vm *vm,
185185
* happens, much more pages are cached there and guest won't see the
186186
* "idle" bit cleared.
187187
*/
188-
if (still_idle < pages / 10)
189-
printf("WARNING: vCPU%d: Too many pages still idle (%" PRIu64
190-
"out of %" PRIu64 "), this will affect performance results"
191-
".\n",
188+
if (still_idle >= pages / 10)
189+
printf("WARNING: vCPU%d: Too many pages still idle (%lu out of %lu), "
190+
"this will affect performance results.\n",
192191
vcpu_idx, still_idle, pages);
193192

194193
close(page_idle_fd);

0 commit comments

Comments
 (0)