lkml.org 
[lkml]   [2015]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v2 0/3] KVM: Dynamic halt_poll_ns
Date
v1 -> v2:
* change kvm_vcpu_block to read halt_poll_ns from the vcpu instead of
the module parameter
* use the shrink/grow matrix which is suggested by David
* set halt_poll_ns_max to 2ms

There is a downside of halt_poll_ns since poll is still happen for idle
VCPU which can waste cpu usage. This patchset add the ability to adjust
halt_poll_ns dynamically.

There are two new kernel parameters for changing the halt_poll_ns:
halt_poll_ns_grow and halt_poll_ns_shrink. A third new parameter,
halt_poll_ns_max, controls the maximal halt_poll_ns; it is internally
rounded down to a closest multiple of halt_poll_ns_grow. The shrink/grow
matrix is suggested by David:

if (poll successfully for interrupt): stay the same
else if (length of kvm_vcpu_block is longer than halt_poll_ns_max): shrink
else if (length of kvm_vcpu_block is less than halt_poll_ns_max): grow

halt_poll_ns_shrink/ |
halt_poll_ns_grow | grow halt_poll_ns | shrink halt_poll_ns
---------------------+----------------------+-------------------
< 1 | = halt_poll_ns | = 0
< halt_poll_ns | *= halt_poll_ns_grow | /= halt_poll_ns_shrink
otherwise | += halt_poll_ns_grow | -= halt_poll_ns_shrink

Wanpeng Li (3):
KVM: make halt_poll_ns per-VCPU
KVM: dynamic halt_poll_ns adjustment
KVM: trace kvm_halt_poll_ns grow/shrink

include/linux/kvm_host.h | 1 +
include/trace/events/kvm.h | 30 ++++++++++++++++++
virt/kvm/kvm_main.c | 78 ++++++++++++++++++++++++++++++++++++++++++++--
3 files changed, 106 insertions(+), 3 deletions(-)

--
1.9.1



\
 
 \ /
  Last update: 2015-08-25 09:01    [W:0.333 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site