From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 3 12:04:24 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9CF31065680; Fri, 3 Jun 2011 12:04:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B0B5F8FC1C; Fri, 3 Jun 2011 12:04:24 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 68E1E46B0D; Fri, 3 Jun 2011 08:04:24 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 03F978A027; Fri, 3 Jun 2011 08:04:24 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 3 Jun 2011 07:50:37 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201105241356.45543.jkim@FreeBSD.org> <201106011655.51233.jkim@FreeBSD.org> <4DE8794B.60100@FreeBSD.org> In-Reply-To: <4DE8794B.60100@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106030750.37264.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 03 Jun 2011 08:04:24 -0400 (EDT) Cc: Jung-uk Kim , Andriy Gapon Subject: Re: [RFC] Enabling invariant TSC timecounter on SMP X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2011 12:04:24 -0000 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