public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC]Enlarge the dalta of TSC match window from one second to five second
@ 2014-08-11  7:41 xiexiangyou
  2014-08-18 11:20 ` Marcelo Tosatti
  0 siblings, 1 reply; 2+ messages in thread
From: xiexiangyou @ 2014-08-11  7:41 UTC (permalink / raw)
  To: kvm, zamsden

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC]Enlarge the dalta of TSC match window from one second to five second
  2014-08-11  7:41 [RFC]Enlarge the dalta of TSC match window from one second to five second xiexiangyou
@ 2014-08-18 11:20 ` Marcelo Tosatti
  0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2014-08-18 11:20 UTC (permalink / raw)
  To: xiexiangyou; +Cc: kvm, zamsden

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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-18 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11  7:41 [RFC]Enlarge the dalta of TSC match window from one second to five second xiexiangyou
2014-08-18 11:20 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox