Lines Matching +full:time +full:- +full:slots

1 // SPDX-License-Identifier: GPL-2.0
13 #include <time.h>
70 struct kvm_vcpu *vcpu = vcpu_args->vcpu; in vcpu_worker()
71 int vcpu_idx = vcpu_args->vcpu_idx; in vcpu_worker()
80 run = vcpu->run; in vcpu_worker()
92 exit_reason_str(run->exit_reason)); in vcpu_worker()
100 pages_count += vcpu_args->pages; in vcpu_worker()
102 pr_debug("vCPU %d iteration %d dirty memory time: %ld.%.9lds\n", in vcpu_worker()
106 pr_debug("vCPU %d iteration %d populate memory time: %ld.%.9lds\n", in vcpu_worker()
131 int slots; member
153 p->slots, p->backing_src, in run_test()
154 p->partition_vcpu_memory_access); in run_test()
156 memstress_set_write_percent(vm, p->write_percent); in run_test()
158 guest_num_pages = (nr_vcpus * guest_percpu_mem_size) >> vm->page_shift; in run_test()
161 pages_per_slot = host_num_pages / p->slots; in run_test()
163 bitmaps = memstress_alloc_bitmaps(p->slots, pages_per_slot); in run_test()
177 vcpu_last_completed_iteration[i] = -1; in run_test()
182 * page. The prevents expensive copy-on-write faults from in run_test()
191 pr_debug("Starting iteration %d - Populating\n", iteration); in run_test()
199 pr_info("Populate memory time: %ld.%.9lds\n", in run_test()
204 memstress_enable_dirty_logging(vm, p->slots); in run_test()
206 pr_info("Enabling dirty logging time: %ld.%.9lds\n\n", in run_test()
209 memstress_set_write_percent(vm, p->write_percent); in run_test()
210 memstress_set_random_access(vm, p->random_access); in run_test()
212 while (iteration < p->iterations) { in run_test()
229 pr_info("Iteration %d dirty memory time: %ld.%.9lds\n", in run_test()
233 memstress_get_dirty_log(vm, bitmaps, p->slots); in run_test()
237 pr_info("Iteration %d get dirty log time: %ld.%.9lds\n", in run_test()
242 memstress_clear_dirty_log(vm, bitmaps, p->slots, in run_test()
247 pr_info("Iteration %d clear dirty log time: %ld.%.9lds\n", in run_test()
254 * in terms of both performance and correctness. Opt-in via command in run_test()
255 * line as this significantly increases time to disable dirty logging. in run_test()
258 WRITE_ONCE(iteration, -1); in run_test()
262 memstress_disable_dirty_logging(vm, p->slots); in run_test()
264 pr_info("Disabling dirty logging time: %ld.%.9lds\n", in run_test()
275 avg = timespec_div(get_dirty_log_total, p->iterations); in run_test()
277 p->iterations, get_dirty_log_total.tv_sec, in run_test()
281 avg = timespec_div(clear_dirty_log_total, p->iterations); in run_test()
283 p->iterations, clear_dirty_log_total.tv_sec, in run_test()
287 memstress_free_bitmaps(bitmaps, p->slots); in run_test()
295 printf("usage: %s [-h] [-a] [-i iterations] [-p offset] [-g] " in help()
296 "[-m mode] [-n] [-b vcpu bytes] [-v vcpus] [-o] [-r random seed ] [-s mem type]" in help()
297 "[-x memslots] [-w percentage] [-c physical cpus to run test on]\n", name); in help()
299 printf(" -a: access memory randomly rather than in order.\n"); in help()
300 printf(" -i: specify iteration counts (default: %"PRIu64")\n", in help()
302 printf(" -g: Do not enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2. This\n" in help()
308 printf(" -p: specify guest physical test memory offset\n" in help()
311 printf(" -n: Run the vCPUs in nested mode (L2)\n"); in help()
312 printf(" -e: Run vCPUs while dirty logging is being disabled. This\n" in help()
315 printf(" -b: specify the size of the memory region which should be\n" in help()
318 printf(" -v: specify the number of vCPUs to run.\n"); in help()
319 printf(" -o: Overlap guest memory accesses instead of partitioning\n" in help()
321 printf(" -r: specify the starting random seed.\n"); in help()
322 backing_src_help("-s"); in help()
323 printf(" -x: Split the memory region into this number of memslots.\n" in help()
325 printf(" -w: specify the percentage of pages which should be written to\n" in help()
326 " as an integer from 0-100 inclusive. This is probabilistic,\n" in help()
327 " so -w X means each page has an X%% chance of writing\n" in help()
328 " and a (100-X)%% chance of reading.\n" in help()
343 .slots = 1, in main()
358 while ((opt = getopt(argc, argv, "ab:c:eghi:m:nop:r:s:v:x:w:")) != -1) { in main()
411 p.slots = atoi_positive("Number of slots", optarg); in main()