Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread Yang Zhang
On 2016/5/24 9:16, David Matlack wrote: On Mon, May 23, 2016 at 6:13 PM, Yang Zhang wrote: On 2016/5/24 2:04, David Matlack wrote: On Sun, May 22, 2016 at 6:26 PM, Yang Zhang wrote: On 2016/5/21 2:37, David Matlack wrote: It's not

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread Yang Zhang
On 2016/5/24 9:16, David Matlack wrote: On Mon, May 23, 2016 at 6:13 PM, Yang Zhang wrote: On 2016/5/24 2:04, David Matlack wrote: On Sun, May 22, 2016 at 6:26 PM, Yang Zhang wrote: On 2016/5/21 2:37, David Matlack wrote: It's not obvious to me why polling for a timer interrupt would

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread Wanpeng Li
2016-05-19 21:57 GMT+08:00 Paolo Bonzini : > > > On 19/05/2016 15:27, Wanpeng Li wrote: >> From: Wanpeng Li >> >> If an emulated lapic timer will fire soon(in the scope of 10us the >> base of dynamic halt-polling, lower-end of message passing workload

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread Wanpeng Li
2016-05-19 21:57 GMT+08:00 Paolo Bonzini : > > > On 19/05/2016 15:27, Wanpeng Li wrote: >> From: Wanpeng Li >> >> If an emulated lapic timer will fire soon(in the scope of 10us the >> base of dynamic halt-polling, lower-end of message passing workload >> latency TCP_RR's poll time < 10us) we can

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread David Matlack
On Mon, May 23, 2016 at 6:13 PM, Yang Zhang wrote: > On 2016/5/24 2:04, David Matlack wrote: >> >> On Sun, May 22, 2016 at 6:26 PM, Yang Zhang >> wrote: >>> >>> On 2016/5/21 2:37, David Matlack wrote: It's not obvious to me why

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread David Matlack
On Mon, May 23, 2016 at 6:13 PM, Yang Zhang wrote: > On 2016/5/24 2:04, David Matlack wrote: >> >> On Sun, May 22, 2016 at 6:26 PM, Yang Zhang >> wrote: >>> >>> On 2016/5/21 2:37, David Matlack wrote: It's not obvious to me why polling for a timer interrupt would improve

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread Yang Zhang
On 2016/5/24 2:04, David Matlack wrote: On Sun, May 22, 2016 at 6:26 PM, Yang Zhang wrote: On 2016/5/21 2:37, David Matlack wrote: It's not obvious to me why polling for a timer interrupt would improve context switch latency. Can you explain a bit more? We have a

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread Yang Zhang
On 2016/5/24 2:04, David Matlack wrote: On Sun, May 22, 2016 at 6:26 PM, Yang Zhang wrote: On 2016/5/21 2:37, David Matlack wrote: It's not obvious to me why polling for a timer interrupt would improve context switch latency. Can you explain a bit more? We have a workload which using high

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread David Matlack
On Sun, May 22, 2016 at 6:26 PM, Yang Zhang wrote: > On 2016/5/21 2:37, David Matlack wrote: >> >> It's not obvious to me why polling for a timer interrupt would improve >> context switch latency. Can you explain a bit more? > > > We have a workload which using high

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-23 Thread David Matlack
On Sun, May 22, 2016 at 6:26 PM, Yang Zhang wrote: > On 2016/5/21 2:37, David Matlack wrote: >> >> It's not obvious to me why polling for a timer interrupt would improve >> context switch latency. Can you explain a bit more? > > > We have a workload which using high resolution timer(less than

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-22 Thread Yang Zhang
On 2016/5/21 2:37, David Matlack wrote: On Thu, May 19, 2016 at 7:04 PM, Yang Zhang wrote: On 2016/5/20 2:36, David Matlack wrote: On Thu, May 19, 2016 at 11:01 AM, David Matlack wrote: On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-22 Thread Yang Zhang
On 2016/5/21 2:37, David Matlack wrote: On Thu, May 19, 2016 at 7:04 PM, Yang Zhang wrote: On 2016/5/20 2:36, David Matlack wrote: On Thu, May 19, 2016 at 11:01 AM, David Matlack wrote: On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: From: Wanpeng Li If an emulated lapic timer

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-20 Thread David Matlack
On Thu, May 19, 2016 at 7:04 PM, Yang Zhang wrote: > On 2016/5/20 2:36, David Matlack wrote: >> >> On Thu, May 19, 2016 at 11:01 AM, David Matlack >> wrote: >>> >>> On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote:

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-20 Thread David Matlack
On Thu, May 19, 2016 at 7:04 PM, Yang Zhang wrote: > On 2016/5/20 2:36, David Matlack wrote: >> >> On Thu, May 19, 2016 at 11:01 AM, David Matlack >> wrote: >>> >>> On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: From: Wanpeng Li If an emulated lapic timer will fire

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Wanpeng Li
2016-05-20 10:04 GMT+08:00 Yang Zhang : > On 2016/5/20 2:36, David Matlack wrote: >> >> On Thu, May 19, 2016 at 11:01 AM, David Matlack >> wrote: >>> >>> On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: From: Wanpeng

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Wanpeng Li
2016-05-20 10:04 GMT+08:00 Yang Zhang : > On 2016/5/20 2:36, David Matlack wrote: >> >> On Thu, May 19, 2016 at 11:01 AM, David Matlack >> wrote: >>> >>> On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: From: Wanpeng Li If an emulated lapic timer will fire soon(in the

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Yang Zhang
On 2016/5/20 2:36, David Matlack wrote: On Thu, May 19, 2016 at 11:01 AM, David Matlack wrote: On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: From: Wanpeng Li If an emulated lapic timer will fire soon(in the scope of

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Yang Zhang
On 2016/5/20 2:36, David Matlack wrote: On Thu, May 19, 2016 at 11:01 AM, David Matlack wrote: On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: From: Wanpeng Li If an emulated lapic timer will fire soon(in the scope of 10us the base of dynamic halt-polling, lower-end of message passing

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread David Matlack
On Thu, May 19, 2016 at 11:01 AM, David Matlack wrote: > On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: >> From: Wanpeng Li >> >> If an emulated lapic timer will fire soon(in the scope of 10us the >> base of dynamic

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread David Matlack
On Thu, May 19, 2016 at 11:01 AM, David Matlack wrote: > On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: >> From: Wanpeng Li >> >> If an emulated lapic timer will fire soon(in the scope of 10us the >> base of dynamic halt-polling, lower-end of message passing workload >> latency TCP_RR's

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread David Matlack
On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: > From: Wanpeng Li > > If an emulated lapic timer will fire soon(in the scope of 10us the > base of dynamic halt-polling, lower-end of message passing workload > latency TCP_RR's poll time < 10us) we

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread David Matlack
On Thu, May 19, 2016 at 6:27 AM, Wanpeng Li wrote: > From: Wanpeng Li > > If an emulated lapic timer will fire soon(in the scope of 10us the > base of dynamic halt-polling, lower-end of message passing workload > latency TCP_RR's poll time < 10us) we can treat it as a short halt, > and poll to

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Christian Borntraeger
On 05/19/2016 05:06 PM, Paolo Bonzini wrote: > > > On 19/05/2016 17:03, Christian Borntraeger wrote: Would this work too and be simpler? Hmm, your patch does only fiddle with the grow/shrink logic (which might be a good idea independently of this change), but the original patch

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Christian Borntraeger
On 05/19/2016 05:06 PM, Paolo Bonzini wrote: > > > On 19/05/2016 17:03, Christian Borntraeger wrote: Would this work too and be simpler? Hmm, your patch does only fiddle with the grow/shrink logic (which might be a good idea independently of this change), but the original patch

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Paolo Bonzini
On 19/05/2016 17:03, Christian Borntraeger wrote: > > > Would this work too and be simpler? > > > Hmm, your patch does only fiddle with the grow/shrink logic (which might > > > be a good idea independently of this change), but the original patch > > > actually takes into account that we have a

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Paolo Bonzini
On 19/05/2016 17:03, Christian Borntraeger wrote: > > > Would this work too and be simpler? > > > Hmm, your patch does only fiddle with the grow/shrink logic (which might > > > be a good idea independently of this change), but the original patch > > > actually takes into account that we have a

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Christian Borntraeger
On 05/19/2016 04:56 PM, Paolo Bonzini wrote: > > > On 19/05/2016 16:52, Christian Borntraeger wrote: Would this work too and be simpler? >> Hmm, your patch does only fiddle with the grow/shrink logic (which might >> be a good idea independently of this change), but the original patch >>

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Christian Borntraeger
On 05/19/2016 04:56 PM, Paolo Bonzini wrote: > > > On 19/05/2016 16:52, Christian Borntraeger wrote: Would this work too and be simpler? >> Hmm, your patch does only fiddle with the grow/shrink logic (which might >> be a good idea independently of this change), but the original patch >>

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Paolo Bonzini
On 19/05/2016 16:52, Christian Borntraeger wrote: >> > Would this work too and be simpler? > Hmm, your patch does only fiddle with the grow/shrink logic (which might > be a good idea independently of this change), but the original patch > actually takes into account that we have a guaranteed

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Paolo Bonzini
On 19/05/2016 16:52, Christian Borntraeger wrote: >> > Would this work too and be simpler? > Hmm, your patch does only fiddle with the grow/shrink logic (which might > be a good idea independently of this change), but the original patch > actually takes into account that we have a guaranteed

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Christian Borntraeger
On 05/19/2016 03:57 PM, Paolo Bonzini wrote: > > > On 19/05/2016 15:27, Wanpeng Li wrote: >> From: Wanpeng Li >> >> If an emulated lapic timer will fire soon(in the scope of 10us the >> base of dynamic halt-polling, lower-end of message passing workload >> latency

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Christian Borntraeger
On 05/19/2016 03:57 PM, Paolo Bonzini wrote: > > > On 19/05/2016 15:27, Wanpeng Li wrote: >> From: Wanpeng Li >> >> If an emulated lapic timer will fire soon(in the scope of 10us the >> base of dynamic halt-polling, lower-end of message passing workload >> latency TCP_RR's poll time < 10us) we

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Paolo Bonzini
On 19/05/2016 15:27, Wanpeng Li wrote: > From: Wanpeng Li > > If an emulated lapic timer will fire soon(in the scope of 10us the > base of dynamic halt-polling, lower-end of message passing workload > latency TCP_RR's poll time < 10us) we can treat it as a short halt, >

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Paolo Bonzini
On 19/05/2016 15:27, Wanpeng Li wrote: > From: Wanpeng Li > > If an emulated lapic timer will fire soon(in the scope of 10us the > base of dynamic halt-polling, lower-end of message passing workload > latency TCP_RR's poll time < 10us) we can treat it as a short halt, > and poll to wait it

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Christian Borntraeger
On 05/19/2016 03:27 PM, Wanpeng Li wrote: > From: Wanpeng Li > > If an emulated lapic timer will fire soon(in the scope of 10us the > base of dynamic halt-polling, lower-end of message passing workload > latency TCP_RR's poll time < 10us) we can treat it as a short halt,

Re: [PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Christian Borntraeger
On 05/19/2016 03:27 PM, Wanpeng Li wrote: > From: Wanpeng Li > > If an emulated lapic timer will fire soon(in the scope of 10us the > base of dynamic halt-polling, lower-end of message passing workload > latency TCP_RR's poll time < 10us) we can treat it as a short halt, > and poll to wait it

[PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Wanpeng Li
From: Wanpeng Li If an emulated lapic timer will fire soon(in the scope of 10us the base of dynamic halt-polling, lower-end of message passing workload latency TCP_RR's poll time < 10us) we can treat it as a short halt, and poll to wait it fire, the fire callback

[PATCH v2] KVM: halt-polling: poll if emulated lapic timer will fire soon

2016-05-19 Thread Wanpeng Li
From: Wanpeng Li If an emulated lapic timer will fire soon(in the scope of 10us the base of dynamic halt-polling, lower-end of message passing workload latency TCP_RR's poll time < 10us) we can treat it as a short halt, and poll to wait it fire, the fire callback apic_timer_fn() will set