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

[Xen-devel] Re: pvclock implementation in pv_ops kernel: why not __nativ

To: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Subject: [Xen-devel] Re: pvclock implementation in pv_ops kernel: why not __native_read_tsc()?
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Fri, 30 Oct 2009 18:17:48 -0700
Cc: "Xen-Devel \(E-mail\)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 30 Oct 2009 18:18:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <e7adfdc0-37e4-461d-bc07-fd71b86415a5@default>
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: <e7adfdc0-37e4-461d-bc07-fd71b86415a5@default>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4
On 10/30/09 16:30, Dan Magenheimer wrote:
> I was looking at rdtsc usages in 2.6.31... you may
> or may not be surprised to hear that there is exactly
> one usage location, at least through boot and some
> basic NFS copying: native_read_tsc().  Digging through
> the pvclock code, I see that pvclock calls native_read_tsc()
> rather than use the __native_read_tsc() inline function.
>   

I already changed it to __native_read_tsc() in xen.git, mostly because
the vsyscall code can't call kernel functions.  But I'm not sure what
the distinction is supposed to be.

> Any reason for this?  It seems an unnecessary extra
> function call for a routine that is used thousands
> of times every second.
>   

I suppose, but the function call is trivial compared to the cost of the
rdtsc itself, or even the lfence barriers surrounding it.

    J

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