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


Groups > linux.kernel > #1406555

Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers

Path csiph.com!goblin2!goblin1!goblin.stu.neva.ru!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod
From Wanpeng Li <kernellwp@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers
Date Wed, 25 May 2016 03:30:02 +0200
Message-ID <rCvO2-2Kd-9@gated-at.bofh.it> (permalink)
References <rCfpU-sX-13@gated-at.bofh.it> <rCt9v-R2-15@gated-at.bofh.it> <rCtMd-1kg-7@gated-at.bofh.it> <rCu5A-1sd-9@gated-at.bofh.it> <rCvbj-2gr-1@gated-at.bofh.it>
X-Original-To David Matlack <dmatlack@google.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=Ek+ipnpu+WhHE8RNCeN1m4HpzyBvZZza2GrJBrorqt4=; b=GvyEFO6hlfIbCm2hO8kalGW0nr1EjG++wOqU5a72trjCIfzxizdBNDQ+Ik9CutFbde R3ftFevBMsH00OGbF1F3WYPkyQoOC1gEMhOov2LTaF8csdY/NYZpfig6pvuNX43Mva+1 g79WJzRq1G3s0l7nReoOc2WfGlI5CGNSXsB9VDJxJwgvnM8s1pkShEHhoBKHswmmj0cN snO0g1J/TPr50VIt4r/tGgNrryr2HLiJveFZbt8JzJprIhSJC6zuzpmG4TGCxPqM9YS0 M3UEjEWA+Va52/tM126Usqn3hhtemn3js+wSIQhT/nNJNLZgP+rzWZ5uo5cgF/c6ZLqK kL1Q==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Ek+ipnpu+WhHE8RNCeN1m4HpzyBvZZza2GrJBrorqt4=; b=h2kJwQWHQN22CIIpSk8FYGSka8TIaooYdY6FcjncMmkoipbBciC4sYeymc/R9HOtSH pKZ+D6J8Cq3jwyvVb0kvPGW374l+iAR4fwRSwJgj7fI30HHekIG5f9yct9OqxiOO469j SWgASh/pRPo220tv5GOM/R5i3lfuAs95b1y/wg35wfdkACr/euQQM/ljW5OqSZJTGiYC 1HTvrGjM7YpIi1I/78nKswrOUZJ5X0wj/u20hDhz2UKbvMPBZCXm/byjEy0+w3/mRQvF +kDH2PDc0lyub/TZljAe/LNATBZ97ZRRPKgs9clNXnhavM8kVcDaHa/fw2epJneLwtm6 bY4Q==
X-Gm-Message-State ALyK8tIqf2gl5s06Z0EtBtKPHrRm2zr7TkW4bco6O+zJwSzVjk1AaY2j82AQrxIN7o8z3Fv8kq7ovUD+UjPwng==
MIME-Version 1.0
X-Received by 10.202.212.86 with SMTP id l83mr652208oig.190.1464139784034; Tue, 24 May 2016 18:29:44 -0700 (PDT)
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 53
Organization linux.* mail to news gateway
X-Original-Cc "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, kvm list <kvm@vger.kernel.org>, Wanpeng Li <wanpeng.li@hotmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Radim Krčmář <rkrcmar@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Yang Zhang <yang.zhang.wz@gmail.com>
X-Original-Date Wed, 25 May 2016 09:29:43 +0800
X-Original-Message-ID <CANRm+Cym=GrOceRe+ET5ddjyuDnprutT18Amw8CVuZg6i=eE6Q@mail.gmail.com>
X-Original-References <1464076674-4024-1-git-send-email-wanpeng.li@hotmail.com> <CALzav=chDBDYuBt4jDbsmdfZK33eT2Ae-MtjhPUxNtPgS9BeEQ@mail.gmail.com> <CANRm+CzpqSPkLBj0i7o-s5Ae2fHRyyWW3nmweC1K94Uwppo4eA@mail.gmail.com> <CALzav=dsyqAE3tUOaqph4gXtAChyQE8+ADcgwYBROt0EEi6Pew@mail.gmail.com> <CANRm+CwhSW6WKjjMTwCEJn5EdZM36rnHD4aoQgd-wB3jhVxQNA@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1406555

Show key headers only | View raw


2016-05-25 8:47 GMT+08:00 Wanpeng Li <kernellwp@gmail.com>:
> 2016-05-25 7:37 GMT+08:00 David Matlack <dmatlack@google.com>:
>> On Tue, May 24, 2016 at 4:11 PM, Wanpeng Li <kernellwp@gmail.com> wrote:
>>> 2016-05-25 6:38 GMT+08:00 David Matlack <dmatlack@google.com>:
>>>> On Tue, May 24, 2016 at 12:57 AM, Wanpeng Li <kernellwp@gmail.com> wrote:
>>>>> From: Wanpeng Li <wanpeng.li@hotmail.com>
>>>>>
>>>>> 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
>>>>> KVM_REQ_PENDING_TIMER, and this flag will be check during busy poll.
>>>>> This can avoid context switch overhead and the latency which we wake
>>>>> up vCPU.
>>>>>
>>>>> This feature is slightly different from current advance expiration
>>>>> way. Advance expiration rely on the vCPU is running(do polling before
>>>>> vmentry). But in some cases, the timer interrupt may be blocked by
>>>>> other thread(i.e., IF bit is clear) and vCPU cannot be scheduled to
>>>>> run immediately. So even advance the timer early, vCPU may still see
>>>>> the latency. But polling is different, it ensures the vCPU to aware
>>>>> the timer expiration before schedule out.
>>>>>
>>>>> echo HRTICK > /sys/kernel/debug/sched_features in dynticks guests.
>
>
>                     ^^^^^^^^^^^^^^^^^
>
>>>>>
>>>>> Context switching - times in microseconds - smaller is better
>>>>> -------------------------------------------------------------------------
>>>>> Host                 OS  2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K
>>>>>                          ctxsw  ctxsw  ctxsw ctxsw  ctxsw   ctxsw   ctxsw
>>>>> --------- ------------- ------ ------ ------ ------ ------ ------- -------
>>>>> kernel     Linux 4.6.0+ 7.9800   11.0   10.8   14.6 9.4300    13.0    10.2 vanilla
>>>>> kernel     Linux 4.6.0+   15.3   13.6   10.7   12.5 9.0000    12.8 7.38000 poll
>>>>
>>>> These results aren't very compelling. Sometimes polling is faster,
>>>> sometimes vanilla is faster, sometimes they are about the same.

Pin vCPUs get more difference.

Context switching - times in microseconds - smaller is better
-------------------------------------------------------------------------
Host                 OS  2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K
                         ctxsw  ctxsw  ctxsw ctxsw  ctxsw   ctxsw   ctxsw
--------- ------------- ------ ------ ------ ------ ------ ------- -------
kernel     Linux 4.6.0+   11.6   14.0   11.8   53.1   12.5 8.16000
11.4 vanilla
kernel     Linux 4.6.0+   45.8   15.1 2.3000   12.9 1.4200    14.6 4.52000 poll

Regards,
Wanpeng Li

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


Thread

[PATCH v4] KVM: halt-polling: poll for the upcoming fire timers Wanpeng Li <kernellwp@gmail.com> - 2016-05-24 10:00 +0200
  Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers Christian Borntraeger <borntraeger@de.ibm.com> - 2016-05-24 19:20 +0200
    Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers Wanpeng Li <kernellwp@gmail.com> - 2016-05-25 01:20 +0200
  Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers David Matlack <dmatlack@google.com> - 2016-05-25 00:40 +0200
    Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers Wanpeng Li <kernellwp@gmail.com> - 2016-05-25 01:20 +0200
      Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers David Matlack <dmatlack@google.com> - 2016-05-25 01:40 +0200
        Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers Wanpeng Li <kernellwp@gmail.com> - 2016-05-25 02:50 +0200
          Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers Wanpeng Li <kernellwp@gmail.com> - 2016-05-25 03:30 +0200
        Re: [PATCH v4] KVM: halt-polling: poll for the upcoming fire timers Yang Zhang <yang.zhang.wz@gmail.com> - 2016-05-25 04:20 +0200

csiph-web