KVM: VMX: Add support for Pause-Loop Exiting
authorZhai, Edwin <edwin.zhai@intel.com>
Fri, 9 Oct 2009 10:03:20 +0000 (18:03 +0800)
committerAvi Kivity <avi@redhat.com>
Thu, 3 Dec 2009 07:32:17 +0000 (09:32 +0200)
commit4b8d54f9726f1159330201c5ed2ea30bce7e63ea
tree903eaf21f46359f3e42a6d4582ca792b73d4b7b9
parentd255f4f2bac81eb798fcf76938147f1f6c756ae2
KVM: VMX: Add support for Pause-Loop Exiting

New NHM processors will support Pause-Loop Exiting by adding 2 VM-execution
control fields:
PLE_Gap    - upper bound on the amount of time between two successive
             executions of PAUSE in a loop.
PLE_Window - upper bound on the amount of time a guest is allowed to execute in
             a PAUSE loop

If the time, between this execution of PAUSE and previous one, exceeds the
PLE_Gap, processor consider this PAUSE belongs to a new loop.
Otherwise, processor determins the the total execution time of this loop(since
1st PAUSE in this loop), and triggers a VM exit if total time exceeds the
PLE_Window.
* Refer SDM volume 3b section 21.6.13 & 22.1.3.

Pause-Loop Exiting can be used to detect Lock-Holder Preemption, where one VP
is sched-out after hold a spinlock, then other VPs for same lock are sched-in
to waste the CPU time.

Our tests indicate that most spinlocks are held for less than 212 cycles.
Performance tests show that with 2X LP over-commitment we can get +2% perf
improvement for kernel build(Even more perf gain with more LPs).

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/include/asm/vmx.h
arch/x86/kvm/vmx.c
This page took 0.027358 seconds and 5 git commands to generate.