From owner-freebsd-arch@freebsd.org Sat Jun 4 11:09:58 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5B0AB69F68; Sat, 4 Jun 2016 11:09:58 +0000 (UTC) (envelope-from seotownsend@icloud.com) Received: from st11p01im-asmtp001.me.com (st11p01im-asmtp001.me.com [17.172.204.151]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78EFD1E55; Sat, 4 Jun 2016 11:09:58 +0000 (UTC) (envelope-from seotownsend@icloud.com) Received: from process-dkim-sign-daemon.st11p01im-asmtp001.me.com by st11p01im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O8801E00S7A6Q00@st11p01im-asmtp001.me.com>; Sat, 04 Jun 2016 10:09:48 +0000 (GMT) Received: from [10.30.1.6] (unknown [104.156.228.75]) by st11p01im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O8800DJDS891630@st11p01im-asmtp001.me.com>; Sat, 04 Jun 2016 10:09:47 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-04_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1606040116 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: CLOCK_MONOTONIC / CLOCK_UPTIME is not really monotonic between threads From: Seo Townsend In-reply-to: Date: Sat, 04 Jun 2016 03:09:44 -0700 Cc: Adrian Chadd , "freebsd-arch@freebsd.org" , FreeBSD Current , FreeBSD Questions , freebsd-threads@freebsd.org Message-id: References: To: Maxim Sobolev X-Mailer: Apple Mail (2.3124) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=4d515a; t=1465034988; bh=kLj1bwabNtxVLQmtlFkraJhlhovJ1iVjbxBt0eUnpiU=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=BvOWAs70DrcIGAR4HE1Bck50E5kbedqOPuAkoGMsSOrWiHcaQKTIuLR9wcXRimCwt S0W2cr+PfTJKropgJhMLiW54rEB5DC/34vreIJWraRyTOlP3BLkrwmlp0lssNw7RNy Qm7W9uWtklW+TXvZgCVeO0gmxxx5GA+27DkjjAzBHzE+z1SlVymS1CpelpUi7bIFFb qfrhmZXyOjvJMmcV9tBOjDZ3jy7i/4k2kv4sJmVgkYlHw3BWdEREuPgyN3xBvBpl3d RB6TdubyzFECYKgLzo8I1P9XSO93midPOnlntnlRoL972ivqvhuJL9RucHWITf+I03 0djXGb0vSDquQ== Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jun 2016 11:09:58 -0000 Heyy, Sure your machine isn=E2=80=99t sitting next to a block hole? :P Many of the names (CLOCK_XXXXXX) seem to be just aliased. https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_time.c#L343 = = I didn=E2=80=99t thoroughly look at this, but it seems like there=E2=80=99= s a margin of noise introduced by drift corrections that might (half ass-edly) explain the = sub millisecond errors you were receiving? https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_tc.c#L1374 = For the larger >1ms errors, ...that=E2=80=99s probably not good? lol. = Might be worth it to try the timersub library function: = (http://www.unix.com/man-page/freebsd/3/timercmp/) to calculate the delta. > On Jun 3, 2016, at 7:28 AM, Maxim Sobolev wrote: >=20 > a. multiple cores. > b. makes no difference > c. yes, I believe so >=20 > kern.timecounter.tsc_shift: 1 > kern.timecounter.smp_tsc_adjust: 0 > kern.timecounter.smp_tsc: 1 > kern.timecounter.invariant_tsc: 1 > machdep.tsc_freq: 2658118740 > machdep.disable_tsc_calibration: 0 > machdep.disable_tsc: 0 >=20 > d. no, single socket Intel Q6700. I've also seen this problem on core > i7-4770 running virtualbox 5.x. I have a hints that this also happens = on > our bigger production boxes, but I have no specifics yet. >=20 > On Thu, Jun 2, 2016 at 10:05 PM, Adrian Chadd > wrote: >=20 >> [snip] >>=20 >> a) is it on one core, or multiple cores? >> b) CLOCK_MONOTONIC_FAST? >> c) is it on a system that /has/ invariant-TSC ? >> d) is this a multi-socket system? >>=20 >>=20 >>=20 >> -adrian >>=20 >>=20 > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to = "freebsd-arch-unsubscribe@freebsd.org"