summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/include/kvm_util_base.h
diff options
context:
space:
mode:
authorVipin Sharma <vipinsh@google.com>2022-11-03 22:17:19 +0300
committerSean Christopherson <seanjc@google.com>2022-11-16 21:03:24 +0300
commitd886724ea81c6a4dc5e37d4ee09287a31ab8335e (patch)
tree9a8efec469058b33158eaef207065b9f1429c382 /tools/testing/selftests/kvm/include/kvm_util_base.h
parent0001725d0f9b5d749540021befb67c117d566416 (diff)
downloadlinux-d886724ea81c6a4dc5e37d4ee09287a31ab8335e.tar.xz
KVM: selftests: Allowing running dirty_log_perf_test on specific CPUs
Add a command line option, -c, to pin vCPUs to physical CPUs (pCPUs), i.e. to force vCPUs to run on specific pCPUs. Requirement to implement this feature came in discussion on the patch "Make page tables for eager page splitting NUMA aware" https://lore.kernel.org/lkml/YuhPT2drgqL+osLl@google.com/ This feature is useful as it provides a way to analyze performance based on the vCPUs and dirty log worker locations, like on the different NUMA nodes or on the same NUMA nodes. To keep things simple, implementation is intentionally very limited, either all of the vCPUs will be pinned followed by an optional main thread or nothing will be pinned. Signed-off-by: Vipin Sharma <vipinsh@google.com> Suggested-by: David Matlack <dmatlack@google.com> Reviewed-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20221103191719.1559407-8-vipinsh@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/kvm_util_base.h')
-rw-r--r--tools/testing/selftests/kvm/include/kvm_util_base.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/testing/selftests/kvm/include/kvm_util_base.h
index e42a09cd24a0..3bf2333ef95d 100644
--- a/tools/testing/selftests/kvm/include/kvm_util_base.h
+++ b/tools/testing/selftests/kvm/include/kvm_util_base.h
@@ -688,6 +688,10 @@ static inline struct kvm_vm *vm_create_with_one_vcpu(struct kvm_vcpu **vcpu,
struct kvm_vcpu *vm_recreate_with_one_vcpu(struct kvm_vm *vm);
+void kvm_pin_this_task_to_pcpu(uint32_t pcpu);
+void kvm_parse_vcpu_pinning(const char *pcpus_string, uint32_t vcpu_to_pcpu[],
+ int nr_vcpus);
+
unsigned long vm_compute_max_gfn(struct kvm_vm *vm);
unsigned int vm_calc_num_guest_pages(enum vm_guest_mode mode, size_t size);
unsigned int vm_num_host_pages(enum vm_guest_mode mode, unsigned int num_guest_pages);