From owner-freebsd-current@FreeBSD.ORG Fri Jul 10 15:40:53 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8932E106564A for ; Fri, 10 Jul 2009 15:40:53 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD0F8FC0A for ; Fri, 10 Jul 2009 15:40:51 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA07149; Fri, 10 Jul 2009 18:40:50 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4A576101.7050905@freebsd.org> Date: Fri, 10 Jul 2009 18:40:49 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.22 (X11/20090630) MIME-Version: 1.0 To: Adrian Chadd References: <4A562960.3010801@freebsd.org> <4A5733A3.20409@freebsd.org> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Andrew Brampton , freebsd-current@freebsd.org Subject: Re: dtrace users opinion solicited (timestamps) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 15:40:53 -0000 on 10/07/2009 17:39 Adrian Chadd said the following: > 2009/7/10 Andriy Gapon : >>> Another problem with this is that on a multicore machine each core may >>> have different TSC values. Has anyone thought how to address this >>> issue? Could we calculate the offset of each core from core0, and then >>> ensure the offset is applied to the tsc value when it is needed? >> Yes. The actual code accounts for inter-CPU/core TSC skew. > > Pardon the stupid question, but how does Solaris deal with this? Not sure what exactly is 'this' in your question. If you mean the whole issue of TSC frequency changing, then my impression from looking at the following file is that they do it very simple - they don't. http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/i86pc/os/timestamp.c I.e. they always use the same frequency for tick->nsec conversion as was passed to tsc_hrtimeinit. Honestly, I was a little bit surprised by this, I expected to find some machinery to catch frequency changes and to track time and tick of the last change. After some googling it seems that they disable any power management that may affect TSC frequency if CPU doesn't have invariant TSC capability. E.g.: http://opensolaris.org/jive/thread.jspa?messageID=389358 http://archive.netbsd.se/?ml=opensolaris-discuss&a=2008-05&t=7477884 -- Andriy Gapon