diff mbox series

[SRU,Xenial] KVM: x86: lower default for halt_poll_ns

Message ID 1516984884-488-2-git-send-email-victor.tapia@canonical.com
State New
Headers show
Series [SRU,Xenial] KVM: x86: lower default for halt_poll_ns | expand

Commit Message

Victor Tapia Jan. 26, 2018, 4:41 p.m. UTC
From: Paolo Bonzini <pbonzini@redhat.com>

BugLink: https://bugs.launchpad.net/bugs/1724614

In some fio benchmarks, halt_poll_ns=400000 caused CPU utilization to
increase heavily even in cases where the performance improvement was
small.  In particular, bandwidth divided by CPU usage was as much as
60% lower.

To some extent this is the expected effect of the patch, and the
additional CPU utilization is only visible when running the
benchmarks.  However, halving the threshold also halves the extra
CPU utilization (from +30-130% to +20-70%) and has no negative
effect on performance.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
(backported from commit b401ee0b85a53e89739ff68a5b1a0667d664afc9)
Signed-off-by: Victor Tapia <victor.tapia@canonical.com>
---
 arch/x86/include/asm/kvm_host.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin Ian King Jan. 29, 2018, 6:04 p.m. UTC | #1
On 26/01/18 16:41, Victor Tapia wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1724614
> 
> In some fio benchmarks, halt_poll_ns=400000 caused CPU utilization to
> increase heavily even in cases where the performance improvement was
> small.  In particular, bandwidth divided by CPU usage was as much as
> 60% lower.
> 
> To some extent this is the expected effect of the patch, and the
> additional CPU utilization is only visible when running the
> benchmarks.  However, halving the threshold also halves the extra
> CPU utilization (from +30-130% to +20-70%) and has no negative
> effect on performance.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> (backported from commit b401ee0b85a53e89739ff68a5b1a0667d664afc9)
> Signed-off-by: Victor Tapia <victor.tapia@canonical.com>
> ---
>  arch/x86/include/asm/kvm_host.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 40be363..4028beb 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -42,7 +42,7 @@
>  
>  #define KVM_PIO_PAGE_OFFSET 1
>  #define KVM_COALESCED_MMIO_PAGE_OFFSET 2
> -#define KVM_HALT_POLL_NS_DEFAULT 400000
> +#define KVM_HALT_POLL_NS_DEFAULT 200000
>  
>  #define KVM_IRQCHIP_NUM_PINS  KVM_IOAPIC_NUM_PINS
>  
> 
Can't argue with the documented performance increase, so it seems
safe enough a change to me.

Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox series

Patch

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 40be363..4028beb 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -42,7 +42,7 @@ 
 
 #define KVM_PIO_PAGE_OFFSET 1
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 2
-#define KVM_HALT_POLL_NS_DEFAULT 400000
+#define KVM_HALT_POLL_NS_DEFAULT 200000
 
 #define KVM_IRQCHIP_NUM_PINS  KVM_IOAPIC_NUM_PINS