<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/kvm/lib/perf_test_util.c, branch linux-5.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-11-16T12:43:28Z</updated>
<entry>
<title>KVM: selftests: Wait for all vCPU to be created before entering guest mode</title>
<updated>2021-11-16T12:43:28Z</updated>
<author>
<name>David Matlack</name>
</author>
<published>2021-11-11T00:12:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89d9a43c1d2d3d703fae25c990a1d98dd178dd17'/>
<id>urn:sha1:89d9a43c1d2d3d703fae25c990a1d98dd178dd17</id>
<content type='text'>
Thread creation requires taking the mmap_sem in write mode, which causes
vCPU threads running in guest mode to block while they are populating
memory. Fix this by waiting for all vCPU threads to be created and start
running before entering guest mode on any one vCPU thread.

This substantially improves the "Populate memory time" when using 1GiB
pages since it allows all vCPUs to zero pages in parallel rather than
blocking because a writer is waiting (which is waiting for another vCPU
that is busy zeroing a 1GiB page).

Before:

  $ ./dirty_log_perf_test -v256 -s anonymous_hugetlb_1gb
  ...
  Populate memory time: 52.811184013s

After:

  $ ./dirty_log_perf_test -v256 -s anonymous_hugetlb_1gb
  ...
  Populate memory time: 10.204573342s

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20211111001257.1446428-4-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Move vCPU thread creation and joining to common helpers</title>
<updated>2021-11-16T12:43:28Z</updated>
<author>
<name>David Matlack</name>
</author>
<published>2021-11-11T00:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=81bcb26172a8f00840e0ca44277272dcb673887a'/>
<id>urn:sha1:81bcb26172a8f00840e0ca44277272dcb673887a</id>
<content type='text'>
Move vCPU thread creation and joining to common helper functions. This
is in preparation for the next commit which ensures that all vCPU
threads are fully created before entering guest mode on any one
vCPU.

No functional change intended.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20211111001257.1446428-3-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Sync perf_test_args to guest during VM creation</title>
<updated>2021-11-16T12:43:27Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2021-11-11T00:03:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13bbc70329c8df003e64c4fbea8678f9db0e75d5'/>
<id>urn:sha1:13bbc70329c8df003e64c4fbea8678f9db0e75d5</id>
<content type='text'>
Copy perf_test_args to the guest during VM creation instead of relying on
the caller to do so at their leisure.  Ideally, tests wouldn't even be
able to modify perf_test_args, i.e. they would have no motivation to do
the sync, but enforcing that is arguably a net negative for readability.

No functional change intended.

[Set wr_fract=1 by default and add helper to override it since the new
 access_tracking_perf_test needs to set it dynamically.]

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20211111000310.1435032-13-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Fill per-vCPU struct during "perf_test" VM creation</title>
<updated>2021-11-16T12:43:27Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2021-11-11T00:03:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf1d59300ab27af6a2e96b4882fe3d9a72b32b15'/>
<id>urn:sha1:cf1d59300ab27af6a2e96b4882fe3d9a72b32b15</id>
<content type='text'>
Fill the per-vCPU args when creating the perf_test VM instead of having
the caller do so.  This helps ensure that any adjustments to the number
of pages (and thus vcpu_memory_bytes) are reflected in the per-VM args.
Automatically filling the per-vCPU args will also allow a future patch
to do the sync to the guest during creation.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
[Updated access_tracking_perf_test as well.]
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20211111000310.1435032-12-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Create VM with adjusted number of guest pages for perf tests</title>
<updated>2021-11-16T12:43:27Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2021-11-11T00:03:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5e8fe2a92e4923b63d1edd6ed53d9856b6515ce'/>
<id>urn:sha1:f5e8fe2a92e4923b63d1edd6ed53d9856b6515ce</id>
<content type='text'>
Use the already computed guest_num_pages when creating the so called
extra VM pages for a perf test, and add a comment explaining why the
pages are allocated as extra pages.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20211111000310.1435032-11-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Remove perf_test_args.host_page_size</title>
<updated>2021-11-16T12:43:26Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2021-11-11T00:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5ac0fd1b90ae811ba51da6a9928633bddefb792'/>
<id>urn:sha1:a5ac0fd1b90ae811ba51da6a9928633bddefb792</id>
<content type='text'>
Remove perf_test_args.host_page_size and instead use getpagesize() so
that it's somewhat obvious that, for tests that care about the host page
size, they care about the system page size, not the hardware page size,
e.g. that the logic is unchanged if hugepages are in play.

No functional change intended.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20211111000310.1435032-10-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Move per-VM GPA into perf_test_args</title>
<updated>2021-11-16T12:43:26Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2021-11-11T00:03:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b91b637f4a595c5be435e215f78b1a3bd8c252b3'/>
<id>urn:sha1:b91b637f4a595c5be435e215f78b1a3bd8c252b3</id>
<content type='text'>
Move the per-VM GPA into perf_test_args instead of storing it as a
separate global variable.  It's not obvious that guest_test_phys_mem
holds a GPA, nor that it's connected/coupled with per_vcpu-&gt;gpa.

No functional change intended.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20211111000310.1435032-9-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Capture per-vCPU GPA in perf_test_vcpu_args</title>
<updated>2021-11-16T12:43:26Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2021-11-11T00:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=613d61182fffca6b36ea0df1e44927ccf45b1e9b'/>
<id>urn:sha1:613d61182fffca6b36ea0df1e44927ccf45b1e9b</id>
<content type='text'>
Capture the per-vCPU GPA in perf_test_vcpu_args so that tests can get
the GPA without having to calculate the GPA on their own.

No functional change intended.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20211111000310.1435032-7-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Use shorthand local var to access struct perf_tests_args</title>
<updated>2021-11-16T12:43:25Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2021-11-11T00:03:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b65e1051e489be4fe783cb14f1cd33235a0f9803'/>
<id>urn:sha1:b65e1051e489be4fe783cb14f1cd33235a0f9803</id>
<content type='text'>
Use 'pta' as a local pointer to the global perf_tests_args in order to
shorten line lengths and make the code borderline readable.

No functional change intended.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20211111000310.1435032-6-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Require GPA to be aligned when backed by hugepages</title>
<updated>2021-11-16T12:43:25Z</updated>
<author>
<name>Sean Christopherson</name>
</author>
<published>2021-11-11T00:03:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69cdcfa6f321da2cc1dd2e62fa4a9ee256299b18'/>
<id>urn:sha1:69cdcfa6f321da2cc1dd2e62fa4a9ee256299b18</id>
<content type='text'>
Assert that the GPA for a memslot backed by a hugepage is aligned to
the hugepage size and fix perf_test_util accordingly.  Lack of GPA
alignment prevents KVM from backing the guest with hugepages, e.g. x86's
write-protection of hugepages when dirty logging is activated is
otherwise not exercised.

Add a comment explaining that guest_page_size is for non-huge pages to
try and avoid confusion about what it actually tracks.

Cc: Ben Gardon &lt;bgardon@google.com&gt;
Cc: Yanan Wang &lt;wangyanan55@huawei.com&gt;
Cc: Andrew Jones &lt;drjones@redhat.com&gt;
Cc: Peter Xu &lt;peterx@redhat.com&gt;
Cc: Aaron Lewis &lt;aaronlewis@google.com&gt;
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
[Used get_backing_src_pagesz() to determine alignment dynamically.]
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20211111000310.1435032-5-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
