Date: Sun, 12 Jul 2020 16:27:49 -0700 From: Conrad Meyer <cem@freebsd.org> To: Alexander Leidinger <netchild@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r363125 - head/sys/compat/linux Message-ID: <CAG6CVpXniVitnrk2qqnkGocHG%2BiPKHfPJ-KuRdaPKbNfTnrE=A@mail.gmail.com> In-Reply-To: <202007120951.06C9pA4F024281@repo.freebsd.org> References: <202007120951.06C9pA4F024281@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Alexander, On Sun, Jul 12, 2020 at 2:51 AM Alexander Leidinger <netchild@freebsd.org> wrote: > > Author: netchild > Date: Sun Jul 12 09:51:09 2020 > New Revision: 363125 > URL: https://svnweb.freebsd.org/changeset/base/363125 > > Log: > Implement CLOCK_MONOTONIC_RAW (linux >=3D 2.6.28). > > It is documented as a raw hardware-based clock not subject to NTP or > incremental adjustments. With this "not as precise as CLOCK_MONOTONIC" > description in mind, map it to our CLOCK_MONOTNIC_FAST (the same > mapping as for the linux CLOCK_MONOTONIC_COARSE). Can you point at the documentation suggesting CLOCK_MONOTONIC_RAW is any less precise than CLOCK_MONOTONIC? I'm looking at the Linux manual page and it does not seem to contain any language to that effect. > This is needed for the webcomponent of steam (chromium) and some > other steam component or game. > > The linux-steam-utils port contains a LD_PRELOAD based fix for this. > There this is mapped to CLOCK_MONOTONIC. > As an untrained ear/eye (=3D the majority of people) is normaly not > noticing a difference of jitter in the 10-20 ms range, specially > if you don't pay attention like for example in a browser session > while watching a video stream, the mapping to CLOCK_MONOTONIC_FAST > seems more appropriate than to CLOCK_MONOTONIC. I don't know how these programs use the clock, but 10-20 ms of jitter in the UI is noticeable to even casual users. (In FreeBSD these functions are purportedly accurate to 1 timer tick, which is 1ms on HZ=3D1000 (amd64) =E2=80=94 much better than 10-20ms.) However, I'm concer= ned this is still insufficient precision compared with the documented behavior of the Linux functions. I think regular CLOCK_MONOTONIC is the closest thing we've got to Linux's CLOCK_MONOTONIC_RAW. The Linux analog of _FAST is _COARSE. Best, Conrad
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpXniVitnrk2qqnkGocHG%2BiPKHfPJ-KuRdaPKbNfTnrE=A>