diff options
author | Wanpeng Li <wanpengli@tencent.com> | 2019-07-24 17:43:13 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-07-24 13:56:53 +0200 |
commit | 266e85a5ec9100dcd9ae03601453bbc96fefee5d (patch) | |
tree | 1c173451c36c301f6e4fcaa9bc400a3314e1037c /tools | |
parent | 2f5947dfcaecb99f2dd559156eecbeb7b95e4c02 (diff) | |
download | linux-266e85a5ec9100dcd9ae03601453bbc96fefee5d.tar.gz linux-266e85a5ec9100dcd9ae03601453bbc96fefee5d.tar.bz2 linux-266e85a5ec9100dcd9ae03601453bbc96fefee5d.zip |
KVM: X86: Boost queue head vCPU to mitigate lock waiter preemption
Commit 11752adb (locking/pvqspinlock: Implement hybrid PV queued/unfair locks)
introduces hybrid PV queued/unfair locks
- queued mode (no starvation)
- unfair mode (good performance on not heavily contended lock)
The lock waiter goes into the unfair mode especially in VMs with over-commit
vCPUs since increaing over-commitment increase the likehood that the queue
head vCPU may have been preempted and not actively spinning.
However, reschedule queue head vCPU timely to acquire the lock still can get
better performance than just depending on lock stealing in over-subscribe
scenario.
Testing on 80 HT 2 socket Xeon Skylake server, with 80 vCPUs VM 80GB RAM:
ebizzy -M
vanilla boosting improved
1VM 23520 25040 6%
2VM 8000 13600 70%
3VM 3100 5400 74%
The lock holder vCPU yields to the queue head vCPU when unlock, to boost queue
head vCPU which is involuntary preemption or the one which is voluntary halt
due to fail to acquire the lock after a short spin in the guest.
Cc: Waiman Long <longman@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions