Re: [PATCH v3 1/2] KVM: LAPIC: Tune lapic_timer_advance_ns smoothly

2019-09-16 Thread Wanpeng Li
On Mon, 16 Sep 2019 at 15:49, Paolo Bonzini wrote: > > On 16/09/19 06:02, Wanpeng Li wrote: > > Hi Paolo, > > > > Something like below? It still fluctuate when running complex guest os > > like linux. Removing timer_advance_adjust_done will hinder introduce > > patch v3 2/2 since there is no adjus

Re: [PATCH v3 1/2] KVM: LAPIC: Tune lapic_timer_advance_ns smoothly

2019-09-16 Thread Paolo Bonzini
On 16/09/19 06:02, Wanpeng Li wrote: > Hi Paolo, > > Something like below? It still fluctuate when running complex guest os > like linux. Removing timer_advance_adjust_done will hinder introduce > patch v3 2/2 since there is no adjust done flag in each round > evaluation. That's not important, si

Re: [PATCH v3 1/2] KVM: LAPIC: Tune lapic_timer_advance_ns smoothly

2019-09-15 Thread Wanpeng Li
On Thu, 12 Sep 2019 at 20:37, Paolo Bonzini wrote: > > On 12/09/19 02:34, Wanpeng Li wrote: > >>> -timer_advance_ns -= min((u32)ns, > >>> -timer_advance_ns / LAPIC_TIMER_ADVANCE_ADJUST_STEP); > >>> +timer_advance_ns -= ns; > > Looking more closely, this assignment... >

Re: [PATCH v3 1/2] KVM: LAPIC: Tune lapic_timer_advance_ns smoothly

2019-09-12 Thread Paolo Bonzini
On 12/09/19 02:34, Wanpeng Li wrote: >>> -timer_advance_ns -= min((u32)ns, >>> -timer_advance_ns / LAPIC_TIMER_ADVANCE_ADJUST_STEP); >>> +timer_advance_ns -= ns; Looking more closely, this assignment... >>>} else { >>>/* too late */ >>>ns = advance_expi

Re: [PATCH v3 1/2] KVM: LAPIC: Tune lapic_timer_advance_ns smoothly

2019-09-11 Thread Paolo Bonzini
On 28/08/19 10:19, Wanpeng Li wrote: > From: Wanpeng Li > > Using a moving average based on per-vCPU lapic_timer_advance_ns to tune > smoothly, filter out drastic fluctuation which prevents this before, > let's assume it is 1 cycles. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Signed-off-