git: fb606db836e5 - stable/15 - umtxq_sleep(): do not wait forever for zero absolute timeouts
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Nov 2026 01:09:42 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=fb606db836e5ed2d8435fc10c9adcd6ffb197a3d
commit fb606db836e5ed2d8435fc10c9adcd6ffb197a3d
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-11-06 00:09:12 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-11-17 00:24:59 +0000
umtxq_sleep(): do not wait forever for zero absolute timeouts
(cherry picked from commit 8c13acc68517f785df4b6c4b016dfd1c6f38c8cf)
---
sys/kern/kern_umtx.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index 6ae344809a51..9d82744ce257 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -888,6 +888,15 @@ umtxq_sleep(struct umtx_q *uq, const char *wmesg,
error = umtx_abs_timeout_getsbt(timo, &sbt, &flags);
if (error != 0)
break;
+
+ /*
+ * msleep() treats zero timeout as no timeout,
+ * return ETIMEDOUT right away.
+ */
+ if ((flags & C_ABSOLUTE) != 0 && sbt == 0) {
+ error = ETIMEDOUT;
+ break;
+ }
}
error = msleep_sbt(uq, &uc->uc_lock, PCATCH | PDROP, wmesg,
sbt, 0, flags);