Re: dtrace users opinion solicited (timestamps)

From: Andriy Gapon <avg_at_freebsd.org>
Date: Fri, 10 Jul 2009 18:40:49 +0300
on 10/07/2009 17:39 Adrian Chadd said the following:
> 2009/7/10 Andriy Gapon <avg_at_freebsd.org>:
>>> 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
Received on Fri Jul 10 2009 - 13:40:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:51 UTC