From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [RFC]Enlarge the dalta of TSC match window from one second to five second Date: Mon, 18 Aug 2014 08:20:38 -0300 Message-ID: <20140818112038.GA16007@amt.cnet> References: <53E8738C.6020601@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, zamsden@redhat.com To: xiexiangyou Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37461 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751960AbaHRLVK (ORCPT ); Mon, 18 Aug 2014 07:21:10 -0400 Content-Disposition: inline In-Reply-To: <53E8738C.6020601@huawei.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Aug 11, 2014 at 03:41:00PM +0800, xiexiangyou wrote: > 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 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Its OK to increase the matching window to 5 seconds. Please send a proper patch.