aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib/perf_test_util.c
diff options
context:
space:
mode:
authorWanpeng Li <[email protected]>2021-05-18 12:00:32 +0000
committerPaolo Bonzini <[email protected]>2021-05-27 11:45:52 +0000
commit72b268a8e9307a1757f61af080e990b5baa11d2a (patch)
tree3582e649e3f5d8da5f0fc99955a90407f903d609 /tools/testing/selftests/kvm/lib/perf_test_util.c
parentKVM: PPC: exit halt polling on need_resched() (diff)
downloadkernel-72b268a8e9307a1757f61af080e990b5baa11d2a.tar.gz
kernel-72b268a8e9307a1757f61af080e990b5baa11d2a.zip
KVM: X86: Bail out of direct yield in case of under-committed scenarios
In case of under-committed scenarios, vCPUs can be scheduled easily; kvm_vcpu_yield_to adds extra overhead, and it is also common to see when vcpu->ready is true but yield later failing due to p->state is TASK_RUNNING. Let's bail out in such scenarios by checking the length of current cpu runqueue, which can be treated as a hint of under-committed instead of guarantee of accuracy. 30%+ of directed-yield attempts can now avoid the expensive lookups in kvm_sched_yield() in an under-committed scenario. Signed-off-by: Wanpeng Li <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/perf_test_util.c')
0 files changed, 0 insertions, 0 deletions