All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Xiaowei" <xiaowei.yang@intel.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] Fix performance issue brought by TSC-sync logic
Date: Tue, 24 Feb 2009 14:33:27 +0800	[thread overview]
Message-ID: <49A394B7.7020806@intel.com> (raw)
In-Reply-To: <C5C7DBE4.317D%keir.fraser@eu.citrix.com>

Keir Fraser wrote:
> On 23/02/2009 00:21, "Yang, Xiaowei" <xiaowei.yang@intel.com> wrote:
> 
>> Recently we found one performance bug when doing network test with VTd
>> assigned devices - in some extreme case, the network performance in HVM
>> using new Linux kernel could be 1/20 of native. Root cause is one of our
>> sync-tsc-under-deep-C-state patches brings extra kilo-TSC drift between
>> pCPUs and let check-tsc-sync logic in HVM failed. The result is the
>> kernel fails to use platform timer (HPET, PMtimer) for gettimeofday
>> instead of TSC and brings very frequent costly IOport access VMExit -
>> triple per one call.
>>
>> We provides below 2 patches to address the issue:
> 
> Patch 1 looks reasonable. Patch number 2 I'm less keen on, since patch 1
> should suffice? Also I think regular re-sync across CPUs is a good idea
> anyway. 

Here is average of 100 cycles skew results on one core 2 quad machine:
1) TSC-sync:            1300
2) TSC-sync+tsc1.patch: 400
3) without TSC-sync:    200 (a.k.a sync at boot time only)

We can see from 1) to 2), cycles skew improves a lot. However Linux 
kernel's logic to check TSC sync (check_tsc_warp) is very strict, so 
even with tsc1.patch, there are still chances to observe checking failed 
inside VM.

For further improvement to reach the effect of 3), e.g. by taking care 
of cache consistance amongs CPUs, there will be more overhead. And 
considering the function is called per second, we are hesitating to do 
this. What's your idea?:)

Thanks,
xiaowei

  parent reply	other threads:[~2009-02-24  6:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-23  8:21 [PATCH] Fix performance issue brought by TSC-sync logic Yang, Xiaowei
2009-02-23 12:51 ` Keir Fraser
2009-02-23 12:55   ` Tian, Kevin
2009-02-24  6:33   ` Yang, Xiaowei [this message]
2009-02-24 12:10     ` Keir Fraser
2009-02-25 10:26       ` Yang, Xiaowei

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=49A394B7.7020806@intel.com \
    --to=xiaowei.yang@intel.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.