Date: Sat, 04 Jun 2016 03:09:44 -0700 From: Seo Townsend <seotownsend@icloud.com> To: Maxim Sobolev <sobomax@FreeBSD.org> Cc: Adrian Chadd <adrian.chadd@gmail.com>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>, FreeBSD Questions <freebsd-questions@freebsd.org>, freebsd-threads@freebsd.org Subject: Re: CLOCK_MONOTONIC / CLOCK_UPTIME is not really monotonic between threads Message-ID: <B93363A9-DBA4-4D9B-81AE-B017C8D8ACE5@icloud.com> In-Reply-To: <CAH7qZftxd=0spJTaAVv2RctXyQmV=cd7JL-xnYnaqfMhoeX7hg@mail.gmail.com> References: <CAH7qZfsBLM_wqdTXiiyVvevwU%2Bu257dX9JvZFftfntduUaZDMw@mail.gmail.com> <CAJ-VmomA%2BwY1Lo7XS86c91hzeJFbMSGpVamfCpM0roaARHcfqg@mail.gmail.com> <CAH7qZftxd=0spJTaAVv2RctXyQmV=cd7JL-xnYnaqfMhoeX7hg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 = <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 = <https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_tc.c#L1347> 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 <sobomax@FreeBSD.org> 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 <adrian.chadd@gmail.com> > 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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B93363A9-DBA4-4D9B-81AE-B017C8D8ACE5>