Lines Matching +full:run +full:- +full:time

1 // SPDX-License-Identifier: GPL-2.0
13 #include <time.h>
33 * The test can still run even if hardware does not support GICv3, as it in arch_setup_vm()
57 /* How many host loops to run by default (one KVM_GET_DIRTY_LOG for each loop)*/
72 struct kvm_vcpu *vcpu = vcpu_args->vcpu; in vcpu_worker()
73 int vcpu_idx = vcpu_args->vcpu_idx; in vcpu_worker()
75 struct kvm_run *run; in vcpu_worker() local
82 run = vcpu->run; in vcpu_worker()
94 exit_reason_str(run->exit_reason)); in vcpu_worker()
102 pages_count += vcpu_args->pages; in vcpu_worker()
104 pr_debug("vCPU %d iteration %d dirty memory time: %ld.%.9lds\n", in vcpu_worker()
108 pr_debug("vCPU %d iteration %d populate memory time: %ld.%.9lds\n", in vcpu_worker()
156 p->slots, p->backing_src, in run_test()
157 p->partition_vcpu_memory_access); in run_test()
159 pr_info("Random seed: %u\n", p->random_seed); in run_test()
160 memstress_set_random_seed(vm, p->random_seed); in run_test()
161 memstress_set_write_percent(vm, p->write_percent); in run_test()
163 guest_num_pages = (nr_vcpus * guest_percpu_mem_size) >> vm->page_shift; in run_test()
166 pages_per_slot = host_num_pages / p->slots; in run_test()
168 bitmaps = memstress_alloc_bitmaps(p->slots, pages_per_slot); in run_test()
182 vcpu_last_completed_iteration[i] = -1; in run_test()
187 * page. The prevents expensive copy-on-write faults from in run_test()
196 pr_debug("Starting iteration %d - Populating\n", iteration); in run_test()
204 pr_info("Populate memory time: %ld.%.9lds\n", in run_test()
209 memstress_enable_dirty_logging(vm, p->slots); in run_test()
211 pr_info("Enabling dirty logging time: %ld.%.9lds\n\n", in run_test()
214 memstress_set_write_percent(vm, p->write_percent); in run_test()
215 memstress_set_random_access(vm, p->random_access); in run_test()
217 while (iteration < p->iterations) { in run_test()
234 pr_info("Iteration %d dirty memory time: %ld.%.9lds\n", in run_test()
238 memstress_get_dirty_log(vm, bitmaps, p->slots); in run_test()
242 pr_info("Iteration %d get dirty log time: %ld.%.9lds\n", in run_test()
247 memstress_clear_dirty_log(vm, bitmaps, p->slots, in run_test()
252 pr_info("Iteration %d clear dirty log time: %ld.%.9lds\n", in run_test()
258 * Run vCPUs while dirty logging is being disabled to stress disabling in run_test()
259 * in terms of both performance and correctness. Opt-in via command in run_test()
260 * line as this significantly increases time to disable dirty logging. in run_test()
263 WRITE_ONCE(iteration, -1); in run_test()
267 memstress_disable_dirty_logging(vm, p->slots); in run_test()
269 pr_info("Disabling dirty logging time: %ld.%.9lds\n", in run_test()
280 avg = timespec_div(get_dirty_log_total, p->iterations); in run_test()
282 p->iterations, get_dirty_log_total.tv_sec, in run_test()
286 avg = timespec_div(clear_dirty_log_total, p->iterations); in run_test()
288 p->iterations, clear_dirty_log_total.tv_sec, in run_test()
292 memstress_free_bitmaps(bitmaps, p->slots); in run_test()
300 printf("usage: %s [-h] [-a] [-i iterations] [-p offset] [-g] " in help()
301 "[-m mode] [-n] [-b vcpu bytes] [-v vcpus] [-o] [-r random seed ] [-s mem type]" in help()
302 "[-x memslots] [-w percentage] [-c physical cpus to run test on]\n", name); in help()
304 printf(" -a: access memory randomly rather than in order.\n"); in help()
305 printf(" -i: specify iteration counts (default: %"PRIu64")\n", in help()
307 printf(" -g: Do not enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2. This\n" in help()
313 printf(" -p: specify guest physical test memory offset\n" in help()
316 printf(" -n: Run the vCPUs in nested mode (L2)\n"); in help()
317 printf(" -e: Run vCPUs while dirty logging is being disabled. This\n" in help()
320 printf(" -b: specify the size of the memory region which should be\n" in help()
323 printf(" -v: specify the number of vCPUs to run.\n"); in help()
324 printf(" -o: Overlap guest memory accesses instead of partitioning\n" in help()
326 printf(" -r: specify the starting random seed.\n"); in help()
327 backing_src_help("-s"); in help()
328 printf(" -x: Split the memory region into this number of memslots.\n" in help()
330 printf(" -w: specify the percentage of pages which should be written to\n" in help()
331 " as an integer from 0-100 inclusive. This is probabilistic,\n" in help()
332 " so -w X means each page has an X%% chance of writing\n" in help()
333 " and a (100-X)%% chance of reading.\n" in help()
361 while ((opt = getopt(argc, argv, "ab:c:eghi:m:nop:r:s:v:x:w:")) != -1) { in main()