]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: dynamic halt-polling
authorWanpeng Li <wanpeng.li@hotmail.com>
Thu, 3 Sep 2015 14:07:38 +0000 (22:07 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 6 Sep 2015 14:32:43 +0000 (16:32 +0200)
commitaca6ff29c4063a8d467cdee241e6b3bf7dc4a171
treee006ea14ead8ae95add04f135dd332bdcbea4bdf
parent19020f8ab83de9dc5a9c8af1f321a526f38bbc40
KVM: dynamic halt-polling

There is a downside of always-poll since poll is still happened for idle
vCPUs which can waste cpu usage. This patchset add the ability to adjust
halt_poll_ns dynamically, to grow halt_poll_ns when shot halt is detected,
and to shrink halt_poll_ns when long halt is detected.

There are two new kernel parameters for changing the halt_poll_ns:
halt_poll_ns_grow and halt_poll_ns_shrink.

                        no-poll      always-poll    dynamic-poll
-----------------------------------------------------------------------
Idle (nohz) vCPU %c0     0.15%        0.3%            0.2%
Idle (250HZ) vCPU %c0    1.1%         4.6%~14%        1.2%
TCP_RR latency           34us         27us            26.7us

"Idle (X) vCPU %c0" is the percent of time the physical cpu spent in
c0 over 60 seconds (each vCPU is pinned to a pCPU). (nohz) means the
guest was tickless. (250HZ) means the guest was ticking at 250HZ.

The big win is with ticking operating systems. Running the linux guest
with nohz=off (and HZ=250), we save 3.4%~12.8% CPUs/second and get close
to no-polling overhead levels by using the dynamic-poll. The savings
should be even higher for higher frequency ticks.

Suggested-by: David Matlack <dmatlack@google.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
[Simplify the patch. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c