lkml.org 
[lkml]   [2021]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 16/43] KVM: Don't redo ktime_get() when calculating halt-polling stop/deadline
From
Date
On Mon, 2021-10-25 at 16:26 +0200, Paolo Bonzini wrote:
> On 09/10/21 04:12, Sean Christopherson wrote:
> > Calculate the halt-polling "stop" time using "cur" instead of redoing
> > ktime_get(). In the happy case where hardware correctly predicts
> > do_halt_poll, "cur" is only a few cycles old. And if the branch is
> > mispredicted, arguably that extra latency should count toward the
> > halt-polling time.
> >
> > In all likelihood, the numbers involved are in the noise and either
> > approach is perfectly ok.
>
> Using "start" makes the change even more obvious, so:
>
> Calculate the halt-polling "stop" time using "start" instead of redoing
> ktime_get(). In practice, the numbers involved are in the noise (e.g.,
> in the happy case where hardware correctly predicts do_halt_poll and
> there are no interrupts, "start" is probably only a few cycles old)
> and either approach is perfectly ok. But it's more precise to count
> any extra latency toward the halt-polling time.
>
> Paolo
>
Agreed.

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>


\
 
 \ /
  Last update: 2021-10-27 16:37    [W:2.197 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site