From mboxrd@z Thu Jan 1 00:00:00 1970 From: xiexiangyou Subject: [RFC]Enlarge the dalta of TSC match window from one second to five second Date: Mon, 11 Aug 2014 15:41:00 +0800 Message-ID: <53E8738C.6020601@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit To: , Return-path: Received: from szxga03-in.huawei.com ([119.145.14.66]:56364 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180AbaHKHlU (ORCPT ); Mon, 11 Aug 2014 03:41:20 -0400 Sender: kvm-owner@vger.kernel.org List-ID: hi, In kvm_write_tsc() func of kvm, The TSCs will be synchronized unless the time diff of creating vcpus small than one second. However, In my enviroment, stress is large, the vcpu creating time is delay, sometimes the diff time between vcpu creating is more than one second. In this case, TSCs in VM are not the same with each other when it boot. (1)To solve the issue, should we enlarge the dalta of TSC match window from one second to five second? as follows: * it's better to try to match offsets from the beginning. */ - if (nsdiff < NSEC_PER_SEC && + if (nsdiff < 5 *NSEC_PER_SEC && vcpu->arch.virtual_tsc_khz == kvm->arch.last_tsc_khz) { if (!check_tsc_unstable()) { (2)Another way to solve the issue: setting all VPUs' tsc_offset equal to the first boot VCPU's. So in special case, hotpluging VCPU, we can ensure TSC clocksource is stable. Thanks. xiexiangyou