All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH v4 0/5] KVM: LAPIC: Optimize timer latency further
Date: Wed, 22 May 2019 16:51:52 +0800	[thread overview]
Message-ID: <CANRm+Cx0o14p_pTp5_dk5-W=mL20E9DHAFK-qYYNNv+5VuSR=Q@mail.gmail.com> (raw)
In-Reply-To: <1558340289-6857-1-git-send-email-wanpengli@tencent.com>

On Mon, 20 May 2019 at 16:18, Wanpeng Li <kernellwp@gmail.com> wrote:
>
> Advance lapic timer tries to hidden the hypervisor overhead between the
> host emulated timer fires and the guest awares the timer is fired. However,
> it just hidden the time between apic_timer_fn/handle_preemption_timer ->
> wait_lapic_expire, instead of the real position of vmentry which is
> mentioned in the orignial commit d0659d946be0 ("KVM: x86: add option to
> advance tscdeadline hrtimer expiration"). There is 700+ cpu cycles between
> the end of wait_lapic_expire and before world switch on my haswell desktop.
>
> This patchset tries to narrow the last gap(wait_lapic_expire -> world switch),
> it takes the real overhead time between apic_timer_fn/handle_preemption_timer
> and before world switch into consideration when adaptively tuning timer
> advancement. The patchset can reduce 40% latency (~1600+ cycles to ~1000+
> cycles on a haswell desktop) for kvm-unit-tests/tscdeadline_latency when
> testing busy waits.

Testing on a Skylake Server, w/ nohz=off, idle=poll in the guest.
Reduces average cyclictest latency from 3us to 2us.

Regards,
Wanpeng Li

      parent reply	other threads:[~2019-05-22  8:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20  8:18 [PATCH v4 0/5] KVM: LAPIC: Optimize timer latency further Wanpeng Li
2019-05-20  8:18 ` [PATCH v4 1/5] KVM: LAPIC: Extract adaptive tune timer advancement logic Wanpeng Li
2019-05-20  8:18 ` [PATCH v4 2/5] KVM: LAPIC: Fix lapic_timer_advance_ns parameter overflow Wanpeng Li
2019-05-20  8:18 ` [PATCH v4 3/5] KVM: LAPIC: Expose per-vCPU timer_advance_ns to userspace Wanpeng Li
2019-05-20  8:18 ` [PATCH v4 4/5] KVM: LAPIC: Delay trace advance expire delta Wanpeng Li
2019-05-20 11:14   ` Paolo Bonzini
2019-05-20 11:22     ` Wanpeng Li
2019-05-20 11:33       ` Paolo Bonzini
2019-05-20 11:36         ` Wanpeng Li
2019-05-20 11:41           ` Paolo Bonzini
2019-05-20 11:45             ` Wanpeng Li
2019-05-20  8:18 ` [PATCH v4 5/5] KVM: LAPIC: Optimize timer latency further Wanpeng Li
2019-05-20 11:16 ` [PATCH v4 0/5] " Paolo Bonzini
2019-05-22  8:51 ` Wanpeng Li [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='CANRm+Cx0o14p_pTp5_dk5-W=mL20E9DHAFK-qYYNNv+5VuSR=Q@mail.gmail.com' \
    --to=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.