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


Groups > linux.kernel > #1405896

Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will fire soon

From Wanpeng Li <kernellwp@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will fire soon
Date 2016-05-24 09:10 +0200
Message-ID <rCeDv-ax-11@gated-at.bofh.it> (permalink)
References <rBMed-7rN-5@gated-at.bofh.it> <rC2sG-Qg-25@gated-at.bofh.it> <rCagy-5zr-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-05-24 10:19 GMT+08:00 Wanpeng Li <kernellwp@gmail.com>:
> 2016-05-24 2:01 GMT+08:00 David Matlack <dmatlack@google.com>:
>> On Sun, May 22, 2016 at 5:42 PM, Wanpeng Li <kernellwp@gmail.com> wrote:
>>> From: Wanpeng Li <wanpeng.li@hotmail.com>
>>
>> I'm ok with this patch, but I'd like to better understand the target
>> workloads. What type of workloads do you expect to benefit from this?
>
> dynticks guests I think is one of workloads which can get benefit,
> there are lots of upcoming fire timers captured by my feature. Even
> during TCP testing. And also the workload of Yang's.
>
>>
>>>
>>> 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.
>>>
>>> iperf TCP get ~6% bandwidth improvement.
>>
>> I think my question got lost in the previous thread :). Can you
>> explain why TCP bandwidth improves with this patch?
>

Please forget TCP stuff. I run lmbench ctx switch benchmark:

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

Regards,
Wanpeng Li

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


Thread

[PATCH v3] KVM: halt-polling: poll if emulated lapic timer will fire soon Wanpeng Li <kernellwp@gmail.com> - 2016-05-23 02:50 +0200
  Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon David Matlack <dmatlack@google.com> - 2016-05-23 20:10 +0200
    Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon Wanpeng Li <kernellwp@gmail.com> - 2016-05-24 04:30 +0200
      Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon Wanpeng Li <kernellwp@gmail.com> - 2016-05-24 04:30 +0200
        Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon Christian Borntraeger <borntraeger@de.ibm.com> - 2016-05-24 09:00 +0200
          Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon Wanpeng Li <kernellwp@gmail.com> - 2016-05-24 09:20 +0200
          Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon Wanpeng Li <kernellwp@gmail.com> - 2016-05-24 09:20 +0200
      Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon Wanpeng Li <kernellwp@gmail.com> - 2016-05-24 09:10 +0200
    Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon Wanpeng Li <kernellwp@gmail.com> - 2016-05-26 10:10 +0200
  Re: [PATCH v3] KVM: halt-polling: poll if emulated lapic timer will  fire soon David Hildenbrand <dahi@linux.vnet.ibm.com> - 2016-05-27 08:50 +0200

csiph-web