Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756605AbbHZJOq (ORCPT ); Wed, 26 Aug 2015 05:14:46 -0400 Received: from blu004-omc1s9.hotmail.com ([65.55.116.20]:60540 "EHLO BLU004-OMC1S9.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752748AbbHZJOo (ORCPT ); Wed, 26 Aug 2015 05:14:44 -0400 X-TMN: [/LsNsiwCbq21DC1hgGyG/kKEA1DCy6XqHK+TbkFgl24=] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: From: Wanpeng Li To: Paolo Bonzini CC: David Matlack , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH v3 0/3] KVM: Dynamic halt_poll_ns Date: Wed, 26 Aug 2015 17:14:30 +0800 X-Mailer: git-send-email 1.9.1 X-OriginalArrivalTime: 26 Aug 2015 09:14:41.0699 (UTC) FILETIME=[A4107F30:01D0DFDF] MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1739 Lines: 45 v2 -> v3: * grow/shrink vcpu->halt_poll_ns by *halt_poll_ns_grow or /halt_poll_ns_shrink * drop the macros and hard coding the numbers in the param definitions * update the comments "5-7 us" * remove halt_poll_ns_max and use halt_poll_ns as the max halt_poll_ns time, vcpu->halt_poll_ns start at zero * drop the wrappers * move the grow/shrink logic before "out:" w/ "if (waited)" 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. 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 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 | 52 +++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 80 insertions(+), 3 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/