From nobody Fri May 29 15:20:30 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gRn9V6PPfz6fhLy for ; Fri, 29 May 2026 15:20:30 +0000 (UTC) (envelope-from git@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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gRn9V4Kxlz43wL for ; Fri, 29 May 2026 15:20:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780068030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QegnKNEgCVV0XAb7gT+YSOMneUj9kmqU1QENOgQpSPU=; b=UlofnFXQYHUti/iQzTIuURtjKMS6JtDsrrtj9b8i0b9eZ4reWgQHUl0O5dmh4wf+rt3Mw8 Bn1YJAo62zACSYuxW69bNwa8EWKmhjqYDTPXX4hxdGqMgNaPgMU03Dl4XTI1lZyGgeHn1T ZEF9rRKk4V8IKJMdnGUtU1x4Cb7zOuj8wd/WMODl9fOm54XrkZejrphYHUwpOVFS0+fmQ9 ECrc5/WV2XKhjeFyAHlwrUitNABBZqGE0xg5CPxplOD1OUpln3W8y7TDkBd0NdiPmnDxED GJp2LfXHRqLSV5NErApzew/w9jI8dRsEoa5OPZX23zVHqzFHr+u1n79j1kQjyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780068030; a=rsa-sha256; cv=none; b=gyfyRAcNAgRtr4Ekjd/ueoBI9oWoBw8GcRAnH0QsYqIXsEY53qQduPHdeAk6oL+EXonu77 Lz18IzHYtE2SJ4tsNrnhAf3REJ+Yt7EQhBc+fW93oY2Gr2SDqMNJkejSW7R0uhVDpBJu71 oHo0UGzSLeMbOQfBjpgNh9orOTmdp71q9jyuNjenXXCxO0lAOssQLG46aebioGgx3/UaRA TtZ5z/FvaCbNV/2qQGcFLOfgHXiekEj2XjY4YZA+w7hcJJGQ/pdj6korWwrwxMCv7z+tC0 VBbgyxXewt+yepHHPr4zticVU51ETIbH2zozZ3TV01Y7KPKXBu2wlPgcfc6Keg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780068030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QegnKNEgCVV0XAb7gT+YSOMneUj9kmqU1QENOgQpSPU=; b=Tcznuztnl9NF+oyj9MlgGacamvu/vKJBYmLFX2Ru0g3lBEEe05MHGdoggQ0FtqFjd8N4uT W9M9zQpGKfW3YRdIo/CnuNqeaZcVUJucovrTtCbMvK4PZ4XdJCUNKbFVvbfHOlGndPy1cI +W/B/lOMyonQP7AiYagvlORUIQmh2TF1LGuMlxW016c+qJnwFIGDd7xGmVydRCGsSiW/we 2nQlq4zaD/wWBQ4LgcUFfQYYoSNfYJ02RP2oxxOGr+YFy9Px0v5mo32ftcThmAY3gvBu9h WNs2Psj8MyYFhiO70Z8/LA9omhCpKwNkf9Uf9tTzX7PEdExuaFPrhpir068Rag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRn9V31f2zdpf for ; Fri, 29 May 2026 15:20:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26fec by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 15:20:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: ShengYi Hung Subject: git: 560f38cec2f7 - stable/15 - kern_time: Honor the precise option when counting diff List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 560f38cec2f7a2f80f745a190e28f5f027b4cd18 Auto-Submitted: auto-generated Date: Fri, 29 May 2026 15:20:30 +0000 Message-Id: <6a19aebe.26fec.7b891c98@gitrepo.freebsd.org> The branch stable/15 has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=560f38cec2f7a2f80f745a190e28f5f027b4cd18 commit 560f38cec2f7a2f80f745a190e28f5f027b4cd18 Author: ShengYi Hung AuthorDate: 2026-03-12 09:16:24 +0000 Commit: ShengYi Hung CommitDate: 2026-05-29 15:19:48 +0000 kern_time: Honor the precise option when counting diff When preecise option is used, the true elapsed time should also use the precise timer. This fixes the test case sleep_for.signals.pass.cpp in libcxx. Reviewed by: kib, imp Approved by: lwhsu (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55824 (cherry picked from commit 728ae49a6b81edb3eec5ab70a63bb83db8f5dce5) --- sys/kern/kern_time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 5b7485c25cd7..2cbb88a15b24 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -601,7 +601,9 @@ kern_clock_nanosleep(struct thread *td, clockid_t clock_id, int flags, } while (error == 0 && is_abs_real && td->td_rtcgen == 0); td->td_rtcgen = 0; if (error != EWOULDBLOCK) { - if (TIMESEL(&sbtt, tmp)) + if (precise) + sbtt = sbinuptime(); + else if (TIMESEL(&sbtt, tmp)) sbtt += tc_tick_sbt; if (sbtt >= sbt) return (0);