From: Greg KH <gregkh@linuxfoundation.org>
To: Anthoine Bourgeois <anthoine.bourgeois@blade-group.com>
Cc: stable@vger.kernel.org,
"Mika Penttilä" <mika.penttila@nextfour.com>,
"Wanpeng Li" <kernellwp@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH 4.14-stable] KVM: x86: remove APIC Timer periodic/oneshot spikes
Date: Mon, 14 May 2018 08:44:11 +0200 [thread overview]
Message-ID: <20180514064411.GA16752@kroah.com> (raw)
In-Reply-To: <20180508081714.24934-1-anthoine.bourgeois@blade-group.com>
On Tue, May 08, 2018 at 08:17:14AM +0000, Anthoine Bourgeois wrote:
> commit ecf08dad723d3e000aecff6c396f54772d124733 upstream.
>
> Since the commit "8003c9ae204e: add APIC Timer periodic/oneshot mode VMX
> preemption timer support", a Windows 10 guest has some erratic timer
> spikes.
>
> Here the results on a 150000 times 1ms timer without any load:
> Before 8003c9ae204e | After 8003c9ae204e
> Max 1834us | 86000us
> Mean 1100us | 1021us
> Deviation 59us | 149us
> Here the results on a 150000 times 1ms timer with a cpu-z stress test:
> Before 8003c9ae204e | After 8003c9ae204e
> Max 32000us | 140000us
> Mean 1006us | 1997us
> Deviation 140us | 11095us
>
> The root cause of the problem is starting hrtimer with an expiry time
> already in the past can take more than 20 milliseconds to trigger the
> timer function. It can be solved by forward such past timers
> immediately, rather than submitting them to hrtimer_start().
> In case the timer is periodic, update the target expiration and call
> hrtimer_start with it.
>
> v2: Check if the tsc deadline is already expired. Thank you Mika.
> v3: Execute the past timers immediately rather than submitting them to
> hrtimer_start().
> v4: Rearm the periodic timer with advance_periodic_target_expiration() a
> simpler version of set_target_expiration(). Thank you Paolo.
>
> Cc: Mika Penttilä <mika.penttila@nextfour.com>
> Cc: Wanpeng Li <kernellwp@gmail.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: <stable@vger.kernel.org> # 4.14.x
> Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@blade-group.com>
> 8003c9ae204e ("KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support")
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
> arch/x86/kvm/lapic.c | 37 ++++++++++++++++++++-----------------
> 1 file changed, 20 insertions(+), 17 deletions(-)
Now applied, thanks.
greg k-h
prev parent reply other threads:[~2018-05-14 6:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 7:15 FAILED: patch "[PATCH] KVM: x86: remove APIC Timer periodic/oneshot spikes" failed to apply to 4.14-stable tree gregkh
2018-05-08 8:17 ` [PATCH 4.14-stable] KVM: x86: remove APIC Timer periodic/oneshot spikes Anthoine Bourgeois
2018-05-14 6:44 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180514064411.GA16752@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=anthoine.bourgeois@blade-group.com \
--cc=kernellwp@gmail.com \
--cc=mika.penttila@nextfour.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).