• Li RongQing's avatar
    KVM: use cpu_relax when halt polling · 74775654
    Li RongQing authored
    
    
    SMT siblings share caches and other hardware, and busy halt polling
    will degrade its sibling performance if its sibling is working
    
    Sean Christopherson suggested as below:
    
    "Rather than disallowing halt-polling entirely, on x86 it should be
    sufficient to simply have the hardware thread yield to its sibling(s)
    via PAUSE.  It probably won't get back all performance, but I would
    expect it to be close.
    This compiles on all KVM architectures, and AFAICT the intended usage
    of cpu_relax() is identical for all architectures."
    Suggested-by: default avatarSean Christopherson <seanjc@google.com>
    Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
    Message-Id: <20210727111247.55510-1-lirongqing@baidu.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    74775654
kvm_main.c 134 KB