From owner-svn-src-head@freebsd.org Sun Jul 12 09:51:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9618335E38B; Sun, 12 Jul 2020 09:51:10 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B4MVQ3RzPz4M59; Sun, 12 Jul 2020 09:51:10 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5ADAE228A3; Sun, 12 Jul 2020 09:51:10 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06C9pArk024294; Sun, 12 Jul 2020 09:51:10 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06C9pA4F024281; Sun, 12 Jul 2020 09:51:10 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <202007120951.06C9pA4F024281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sun, 12 Jul 2020 09:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363125 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 363125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2020 09:51:10 -0000 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 >= 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). 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 (= 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. Modified: head/sys/compat/linux/linux_time.c Modified: head/sys/compat/linux/linux_time.c ============================================================================== --- head/sys/compat/linux/linux_time.c Sun Jul 12 09:49:53 2020 (r363124) +++ head/sys/compat/linux/linux_time.c Sun Jul 12 09:51:09 2020 (r363125) @@ -212,6 +212,7 @@ linux_to_native_clockid(clockid_t *n, clockid_t l) *n = CLOCK_THREAD_CPUTIME_ID; break; case LINUX_CLOCK_REALTIME_COARSE: + case LINUX_CLOCK_MONOTONIC_RAW: *n = CLOCK_REALTIME_FAST; break; case LINUX_CLOCK_MONOTONIC_COARSE: @@ -220,7 +221,6 @@ linux_to_native_clockid(clockid_t *n, clockid_t l) case LINUX_CLOCK_BOOTTIME: *n = CLOCK_UPTIME; break; - case LINUX_CLOCK_MONOTONIC_RAW: case LINUX_CLOCK_REALTIME_ALARM: case LINUX_CLOCK_BOOTTIME_ALARM: case LINUX_CLOCK_SGI_CYCLE: