Date: Fri, 29 May 2026 15:20:30 +0000 From: ShengYi Hung <aokblast@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 560f38cec2f7 - stable/15 - kern_time: Honor the precise option when counting diff Message-ID: <6a19aebe.26fec.7b891c98@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=560f38cec2f7a2f80f745a190e28f5f027b4cd18 commit 560f38cec2f7a2f80f745a190e28f5f027b4cd18 Author: ShengYi Hung <aokblast@FreeBSD.org> AuthorDate: 2026-03-12 09:16:24 +0000 Commit: ShengYi Hung <aokblast@FreeBSD.org> 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);home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a19aebe.26fec.7b891c98>
