lkml.org 
[lkml]   [2021]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v4 2/5] KVM: X86: Bail out of direct yield in case of under-committed scenarios
    From
    Date
    On 19/05/21 04:57, Wanpeng Li wrote:
    > Looks good. Hope Paolo can update the patch description when applying.:)
    >
    > "In case of under-committed scenarios, vCPU can get scheduling easily,
    > kvm_vcpu_yield_to add extra overhead, we can observe a lot of races
    > between vcpu->ready is true and yield fails due to p->state is
    > TASK_RUNNING. Let's bail out in such scenarios by checking the length
    > of current cpu runqueue, it can be treated as a hint of under-committed
    > instead of guaranteeing accuracy. 30%+ of directed-yield attempts can
    > avoid the expensive lookups in kvm_sched_yield() in an under-committed
    > scenario. "
    >

    Here is what I used:

    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.

    Paolo

    \
     
     \ /
      Last update: 2021-05-24 15:42    [W:5.217 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site