WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Fix performance issue brought by TSC-sync logic

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix performance issue brought by TSC-sync logic
From: "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>
Date: Tue, 24 Feb 2009 14:33:27 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 23 Feb 2009 22:34:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C5C7DBE4.317D%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C5C7DBE4.317D%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.19 (X11/20090105)
Keir Fraser wrote:
On 23/02/2009 00:21, "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel