[PATCH 0/3] KVM: Dynamic halt_poll_ns

From: Wanpeng Li
Date: Mon Aug 24 2015 - 08:53:39 EST


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, grows halt_poll_ns if an interrupt arrives and
shrinks halt_poll_ns when idle VCPU is detected.

There are two new kernel parameters for changing the halt_poll_ns:
halt_poll_ns_grow and halt_poll_ns_shrink. halt_poll_ns_grow affects
halt_poll_ns when an interrupt arrives and halt_poll_ns_shrink
does it when idle VCPU is detected.

halt_poll_ns_shrink/ |
halt_poll_ns_grow | interrupt arrives | idle VCPU is detected
---------------------+----------------------+-------------------
< 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

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.

Wanpeng Li (3):
KVM: make halt_poll_ns per-VCPU
KVM: dynamise 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 | 90 +++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 120 insertions(+), 1 deletion(-)

--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/