Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: selftests: Disable dirty logging with vCPUs running

Disabling dirty logging is much more intestesting from a testing
perspective if the vCPUs are still running. This also excercises the
code-path in which collapsible SPTEs must be faulted back in at a higher
level after disabling dirty logging.

To: linux-kselftest@vger.kernel.org
CC: Peter Xu <peterx@redhat.com>
CC: Andrew Jones <drjones@redhat.com>
CC: Thomas Huth <thuth@redhat.com>
Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20210202185734.1680553-29-bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Ben Gardon and committed by
Paolo Bonzini
c1d1650f 9e965bb7

+5 -5
+5 -5
tools/testing/selftests/kvm/dirty_log_perf_test.c
··· 211 211 } 212 212 } 213 213 214 - /* Tell the vcpu thread to quit */ 215 - host_quit = true; 216 - for (vcpu_id = 0; vcpu_id < nr_vcpus; vcpu_id++) 217 - pthread_join(vcpu_threads[vcpu_id], NULL); 218 - 219 214 /* Disable dirty logging */ 220 215 clock_gettime(CLOCK_MONOTONIC, &start); 221 216 vm_mem_region_set_flags(vm, PERF_TEST_MEM_SLOT_INDEX, 0); 222 217 ts_diff = timespec_elapsed(start); 223 218 pr_info("Disabling dirty logging time: %ld.%.9lds\n", 224 219 ts_diff.tv_sec, ts_diff.tv_nsec); 220 + 221 + /* Tell the vcpu thread to quit */ 222 + host_quit = true; 223 + for (vcpu_id = 0; vcpu_id < nr_vcpus; vcpu_id++) 224 + pthread_join(vcpu_threads[vcpu_id], NULL); 225 225 226 226 avg = timespec_div(get_dirty_log_total, p->iterations); 227 227 pr_info("Get dirty log over %lu iterations took %ld.%.9lds. (Avg %ld.%.9lds/iteration)\n",