Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1370898

Re: [PATCH] kvm: x86: make lapic hrtimer pinned

From Rik van Riel <riel@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] kvm: x86: make lapic hrtimer pinned
Date 2016-04-04 23:10 +0200
Message-ID <rkjUZ-Jj-9@gated-at.bofh.it> (permalink)
References <rkjBF-lz-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, 2016-04-04 at 16:46 -0400, Luiz Capitulino wrote:
> When a vCPU runs on a nohz_full core, the hrtimer used by
> the lapic emulation code can be migrated to another core.
> When this happens, it's possible to observe milisecond
> latency when delivering timer IRQs to KVM guests.
> 
> The huge latency is mainly due to the fact that
> apic_timer_fn() expects to run during a kvm exit. It
> sets KVM_REQ_PENDING_TIMER and let it be handled on kvm
> entry. However, if the timer fires on a different core,
> we have to wait until the next kvm exit for the guest
> to see KVM_REQ_PENDING_TIMER set.
> 
> This problem became visible after commit 9642d18ee. This
> commit changed the timer migration code to always attempt
> to migrate timers away from nohz_full cores. While it's
> discussable if this is correct/desirable (I don't think
> it is), it's clear that the lapic emulation code has
> a requirement on firing the hrtimer in the same core
> where it was started. This is achieved by making the
> hrtimer pinned.

Given that delivering a timer to a guest seems to
involve trapping from the guest to the host, anyway,
I don't see a downside to your patch.

If that is ever changed (eg. allowing delivery of
a timer interrupt to a VCPU without trapping to the
host), we may want to revisit this.

Until then...

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All Rights Reversed.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] kvm: x86: make lapic hrtimer pinned Luiz Capitulino <lcapitulino@redhat.com> - 2016-04-04 22:50 +0200
  Re: [PATCH] kvm: x86: make lapic hrtimer pinned Rik van Riel <riel@redhat.com> - 2016-04-04 23:10 +0200
    Re: [PATCH] kvm: x86: make lapic hrtimer pinned Yang Zhang <yang.zhang.wz@gmail.com> - 2016-04-05 08:20 +0200
      Re: [PATCH] kvm: x86: make lapic hrtimer pinned Luiz Capitulino <lcapitulino@redhat.com> - 2016-04-05 14:50 +0200
      Re: [PATCH] kvm: x86: make lapic hrtimer pinned Radim Krčmář <rkrcmar@redhat.com> - 2016-04-05 18:00 +0200
        Re: [PATCH] kvm: x86: make lapic hrtimer pinned Yang Zhang <yang.zhang.wz@gmail.com> - 2016-04-07 04:10 +0200
  Re: [PATCH] kvm: x86: make lapic hrtimer pinned Paolo Bonzini <pbonzini@redhat.com> - 2016-04-05 12:10 +0200

csiph-web