OSDN Git Service

KVM: selftests: memslot_perf_test: Probe memory slots for once
authorGavin Shan <gshan@redhat.com>
Thu, 20 Oct 2022 07:12:06 +0000 (15:12 +0800)
committerMarc Zyngier <maz@kernel.org>
Thu, 10 Nov 2022 18:56:15 +0000 (18:56 +0000)
commit34396437b11f904fc61b272e3974f4c92868451b
tree1b8d7f50293863cc5e213c4c90a2e752d2251a11
parent2aae5e6795e1407334bb849f96f11c9051b959e2
KVM: selftests: memslot_perf_test: Probe memory slots for once

prepare_vm() is called in every iteration and run. The allowed memory
slots (KVM_CAP_NR_MEMSLOTS) are probed for multiple times. It's not
free and unnecessary.

Move the probing logic for the allowed memory slots to parse_args()
for once, which is upper layer of prepare_vm().

No functional change intended.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221020071209.559062-4-gshan@redhat.com
tools/testing/selftests/kvm/memslot_perf_test.c