lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 12 Dec 2017 15:00:40 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Wanpeng Li <kernellwp@...il.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org
Cc:     Radim Krčmář <rkrcmar@...hat.com>,
        Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [PATCH] KVM: X86: Reduce the overhead when lapic_timer_advance is
 disabled

On 01/12/2017 09:15, Wanpeng Li wrote:
> When I run ebizzy in a 32 vCPUs guest on a 32 pCPUs Xeon box, I can observe 
> ~8000 kvm_wait_lapic_expire CurAvg/s through kvm_stat tool even if the advance 
> tscdeadline hrtimer expiration is disabled. Each call to wait_lapic_expire() 
> will consume ~70 cycles when a timer fires since apic_timer_expire() will 
> set expired_tscdeadline and then wait_lapic_expire() will do some caculation 
> before bailing out. So total ~175us per second is lost on this 3.2Ghz machine. 
> This patch reduces the overhead by skipping the function wait_lapic_expire() 
> when lapic_timer_advance is disabled.
> 
> Cc: Paolo Bonzini <pbonzini@...hat.com>
> Cc: Radim Krčmář <rkrcmar@...hat.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@...mail.com>
> ---
>  arch/x86/kvm/x86.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 50c8361..d1abf13 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -6994,7 +6994,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
>  	}
>  
>  	trace_kvm_entry(vcpu->vcpu_id);
> -	wait_lapic_expire(vcpu);
> +	if (lapic_timer_advance_ns)
> +		wait_lapic_expire(vcpu);
>  	guest_enter_irqoff();
>  
>  	if (unlikely(vcpu->arch.switch_db_regs)) {
> 

Queued, thanks.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ