Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jun 2011 07:50:37 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Jung-uk Kim <jkim@freebsd.org>, Andriy Gapon <avg@freebsd.org>
Subject:   Re: [RFC] Enabling invariant TSC timecounter on SMP
Message-ID:  <201106030750.37264.jhb@freebsd.org>
In-Reply-To: <4DE8794B.60100@FreeBSD.org>
References:  <201105241356.45543.jkim@FreeBSD.org> <201106011655.51233.jkim@FreeBSD.org> <4DE8794B.60100@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, June 03, 2011 2:03:55 am Andriy Gapon wrote:
> > Consecutive RDTSCs used on a same CPU is always incremental but we 
> > cannot 100% guarantee that on two cores, even if TSC is derived from 
> > the same clock.  I am hoping at least latency difference (I believe 
> > it's about few tens of cycles max) is "eaten up" by lowering 
> > resolution.  It's not perfect but it's better than serialization 
> > (Linux) or heuristics (OpenSolaris), just because there are few rare 
> > conditions to consider.  Thoughts?
> 
> I am still not sure which case this code should solve.
> 
> Thread T1: x1 = rdtsc() on CPU1;
> Thread T1: x2 = rdtsc() on CPU2;
> x2 < x1 ?
> Or?

Yes, that can happen.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106030750.37264.jhb>