linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: LAPIC: Reset timer_advance_ns to 1000 after adaptive tuning goes insane
@ 2019-07-05  9:40 Wanpeng Li
  2019-07-05  9:50 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Wanpeng Li @ 2019-07-05  9:40 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: Paolo Bonzini, Radim Krčmář

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 972 bytes --]

From: Wanpeng Li <wanpengli@tencent.com>

Reset timer_advance_ns to the default value 1000ns after adaptive tuning 
goes insane which can happen sporadically in product environment.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
---
 arch/x86/kvm/lapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 05d8934..454d3dd 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1549,7 +1549,7 @@ static inline void adjust_lapic_timer_advance(struct kvm_vcpu *vcpu,
 	if (abs(advance_expire_delta) < LAPIC_TIMER_ADVANCE_ADJUST_DONE)
 		apic->lapic_timer.timer_advance_adjust_done = true;
 	if (unlikely(timer_advance_ns > 5000)) {
-		timer_advance_ns = 0;
+		timer_advance_ns = 1000;
 		apic->lapic_timer.timer_advance_adjust_done = true;
 	}
 	apic->lapic_timer.timer_advance_ns = timer_advance_ns;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: LAPIC: Reset timer_advance_ns to 1000 after adaptive tuning goes insane
  2019-07-05  9:40 [PATCH] KVM: LAPIC: Reset timer_advance_ns to 1000 after adaptive tuning goes insane Wanpeng Li
@ 2019-07-05  9:50 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-07-05  9:50 UTC (permalink / raw)
  To: Wanpeng Li, linux-kernel, kvm; +Cc: Radim Krčmář

On 05/07/19 11:40, Wanpeng Li wrote:
> From: Wanpeng Li <wanpengli@tencent.com>
> 
> Reset timer_advance_ns to the default value 1000ns after adaptive tuning 
> goes insane which can happen sporadically in product environment.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
> ---
>  arch/x86/kvm/lapic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 05d8934..454d3dd 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -1549,7 +1549,7 @@ static inline void adjust_lapic_timer_advance(struct kvm_vcpu *vcpu,
>  	if (abs(advance_expire_delta) < LAPIC_TIMER_ADVANCE_ADJUST_DONE)
>  		apic->lapic_timer.timer_advance_adjust_done = true;
>  	if (unlikely(timer_advance_ns > 5000)) {
> -		timer_advance_ns = 0;
> +		timer_advance_ns = 1000;
>  		apic->lapic_timer.timer_advance_adjust_done = true;

Do you also want to reset timer_advance_adjust_done to false?

Paolo

>  	}
>  	apic->lapic_timer.timer_advance_ns = timer_advance_ns;
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-05  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05  9:40 [PATCH] KVM: LAPIC: Reset timer_advance_ns to 1000 after adaptive tuning goes insane Wanpeng Li
2019-07-05  9:50 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).