Re: [PATCH v3 2/3] KVM: selftests: Randomize which pages are written vs read.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ricardo Koller <ricarkol@xxxxxxxxxx> writes:

On Thu, Sep 01, 2022 at 07:52:36PM +0000, Colton Lewis wrote:
Randomize which pages are written vs read using the random number
generator.
nit:       ^ I haven't seen this style before (the period at the end)


I will change style in future patches, but checkpatch doesn't complain
and there are many examples in git history.

$ git log --oneline | grep '\.$' | wc -l
  43812

diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c
index 2f91acd94130..c9441f8354be 100644
--- a/tools/testing/selftests/kvm/dirty_log_perf_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c
@@ -122,10 +122,10 @@ static void vcpu_worker(struct perf_test_vcpu_args *vcpu_args)
  struct test_params {
  	unsigned long iterations;
  	uint64_t phys_offset;
-	int wr_fract;
  	bool partition_vcpu_memory_access;
  	enum vm_mem_backing_src_type backing_src;
  	int slots;
+	uint32_t write_percent;

nit: make it an int to match perf_test_args.write_percent


That inconsistency bothers me. I'll make perf_test_args.write_percent a
uint32 instead since that's what most of the code uses. Will take care
of your other nits while I'm at it.

@@ -413,10 +414,11 @@ int main(int argc, char *argv[])
  		case 'b':
  			guest_percpu_mem_size = parse_size(optarg);
  			break;
-		case 'f':
-			p.wr_fract = atoi(optarg);
-			TEST_ASSERT(p.wr_fract >= 1,
-				    "Write fraction cannot be less than one");
+		case 'w':
+			perf_test_args.write_percent = atoi(optarg);

I'm a bit confused, where is p.write_percent being set? I later see

	perf_test_set_write_percent(vm, p->write_percent);

that rewrites perf_test_args.write_percent with whatever was in
p->write_percent.


Hmm. Thought I fixed that mistake before. Should be p.write_percent
there.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux