Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932712AbbHXMxg (ORCPT ); Mon, 24 Aug 2015 08:53:36 -0400 Received: from blu004-omc1s29.hotmail.com ([65.55.116.40]:49622 "EHLO BLU004-OMC1S29.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754473AbbHXMxe (ORCPT ); Mon, 24 Aug 2015 08:53:34 -0400 X-TMN: [KXkk6KF1H9pkJc64F5LpZd/SydWtb34X] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: From: Wanpeng Li To: Paolo Bonzini CC: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH 0/3] KVM: Dynamic halt_poll_ns Date: Mon, 24 Aug 2015 20:53:21 +0800 X-Mailer: git-send-email 1.9.1 X-OriginalArrivalTime: 24 Aug 2015 12:53:32.0618 (UTC) FILETIME=[E1E03AA0:01D0DE6B] 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: 1626 Lines: 38 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/