public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: xiexiangyou <xiexiangyou@huawei.com>
Cc: kvm@vger.kernel.org, zamsden@redhat.com
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	[thread overview]
Message-ID: <20140818112038.GA16007@amt.cnet> (raw)
In-Reply-To: <53E8738C.6020601@huawei.com>

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.



      reply	other threads:[~2014-08-18 11:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140818112038.GA16007@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=xiexiangyou@huawei.com \
    --cc=zamsden@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox