Re: [PATCH] KVM: VMX: Optimize flushing the PML buffer

2021-02-04 Thread Ben Gardon
On Thu, Feb 4, 2021 at 2:51 PM Peter Xu wrote: > > Hi, Ben, > > On Thu, Feb 04, 2021 at 02:19:59PM -0800, Ben Gardon wrote: > > The average time for each run demonstrated a strange bimodal distribution, > > with clusters around 2 seconds and 2.5 seconds. This may have been a > > result of vCPU mig

Re: [PATCH] KVM: VMX: Optimize flushing the PML buffer

2021-02-04 Thread Peter Xu
Hi, Ben, On Thu, Feb 04, 2021 at 02:19:59PM -0800, Ben Gardon wrote: > The average time for each run demonstrated a strange bimodal distribution, > with clusters around 2 seconds and 2.5 seconds. This may have been a > result of vCPU migration between NUMA nodes. Have you thought about using numa

[PATCH] KVM: VMX: Optimize flushing the PML buffer

2021-02-04 Thread Ben Gardon
vmx_flush_pml_buffer repeatedly calls kvm_vcpu_mark_page_dirty, which SRCU-derefrences kvm->memslots. In order to give the compiler more freedom to optimize the function, SRCU-dereference the pointer kvm->memslots only once. Reviewed-by: Makarand Sonare Signed-off-by: Ben Gardon --- Tested by