From owner-freebsd-current@FreeBSD.ORG Thu Apr 10 16:23:51 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57F2A1065673 for ; Thu, 10 Apr 2008 16:23:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outG.internet-mail-service.net (outg.internet-mail-service.net [216.240.47.230]) by mx1.freebsd.org (Postfix) with ESMTP id 3C4C48FC20 for ; Thu, 10 Apr 2008 16:23:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Thu, 10 Apr 2008 14:58:28 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 8D10C2D6016; Thu, 10 Apr 2008 09:23:46 -0700 (PDT) Message-ID: <47FE3F15.6070400@elischer.org> Date: Thu, 10 Apr 2008 09:23:49 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Matthew Dillon References: <200804100716.m3A7G1BD039275@apollo.backplane.com> In-Reply-To: <200804100716.m3A7G1BD039275@apollo.backplane.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: gnn@freebsd.org, current@freebsd.org Subject: Re: TSC Timecounter and multi-core/SMP 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: Thu, 10 Apr 2008 16:23:51 -0000 Matthew Dillon wrote: > > :Howdy, > : > :Is the TSC timecounter synchronized across multiple cores and/or > :processors? A quick search seems to indicate it's not but I'd like to > :find a definitive reference on the TSC. > : > :Thanks, > :George > > At least on AMD X2 boxes they are not synchronized. The absolute > values of the TSC counters will be off and they will also drift > relative to each other, which can readily be demonstrated with some > test IPIs on DragonFly with the TSC synchronization code turned off. > > In these tests a single IPI is sent from one cpu to another and > the absolute value of each cpu's TSC is recorded. The number in the > parenthesis is the difference between the two absolute values. > > The difference should be about the same same when the test is repeated, > but as you can see the gap increases in each successive test. > > index cpu timestamp ID trace > 0140bb 0 1083883698618 testlog_pingpong pingpong (720862) > 00f619 1 1083882977756 testlog_pingpong pingpong > > 0140bc 0 1143172876697 testlog_pingpong pingpong (768494) > 00f61a 1 1143172108203 testlog_pingpong pingpong > > 0140bd 0 1164275800252 testlog_pingpong pingpong (785266) > 00f61b 1 1164275014986 testlog_pingpong pingpong > > 0140be 0 1179148341147 testlog_pingpong pingpong (799137) > 00f61c 1 1179147542010 testlog_pingpong pingpong > > So not only are the TSC's not synchronized with each other, but their > frequencies are also not locked relative to each other. There will > a small amount of drift for each cpu and I'm guessing the dift will > also slide around a bit based on temperature. > > Intel might work differently but I don't have any intel multi-cores > handy to run the test on so I don't know. Someone once told me that there was some complication WRT the TSC and SMI interrupts too.. though I can't remember what it was exactly.. I do however remember thinking "That's insane!" > > -Matt > Matthew Dillon > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"