Home | History | Annotate | Download | only in sys
History log of /src/tests/lib/libc/sys/t_futex_ops.c
RevisionDateAuthorComments
 1.14  05-Mar-2025  riastradh futex(2): Sign-extend FUTEX_WAKE_OP oparg/cmparg as Linux does.

Also mask off bits in the FUTEX_OP macro as Linux does so that passing
negative arguments works like in Linux.

PR kern/59129: futex(3): missing sign extension in FUTEX_WAKE_OP
 1.13  05-Mar-2025  riastradh t_futex_ops: Test sign-extension of WAKE_OP oparg/cmparg.

PR kern/59129: futex(3): missing sign extension in FUTEX_WAKE_OP
 1.12  05-Mar-2025  riastradh t_futex_ops: Relax various ATF_REQUIRE_* to ATF_CHECK_*.

This makes the test output more usable for browsing diagnostics when
multi-part tests partially fail.

Preparation for:

PR kern/59129: futex(3): missing sign extension in FUTEX_WAKE_OP
 1.11  05-Mar-2025  riastradh t_futex_ops: Spruce up diagnostics.

- Use RL to report errno for any syscalls that set it.
- Sprinkle messages to show intermediate quantities.

Preparation for:

PR kern/59129: futex(3): missing sign extension in FUTEX_WAKE_OP
 1.10  18-Jan-2025  riastradh futex(2): Fix return value of FUTEX_CMP_REQUEUE.

The return value is the number of waiters woken _or requeued_, not
just the number of waiters woken:

FUTEX_CMP_REQUEUE
Returns the total number of waiters that were woken up or
requeued to the futex for the futex word at uaddr2. If
this value is greater than val, then the difference is the
number of waiters requeued to the futex for the futex word
at uaddr2.

https://man7.org/linux/man-pages/man2/futex.2.html

While here, clarify some of the arguments with comments so it's not
quite so cryptic with val/val2/val3 everywhere.

PR kern/56828: futex calls in Linux emulation sometimes hang
 1.9  18-Jan-2025  riastradh futex(2): Fix FUTEX_CMP_REQUEUE to always compare even if no waiters.

It must always compare the futex value and fail with EAGAIN on
mismatch, even if there are no waiters.

FUTEX_CMP_REQUEUE (since Linux 2.6.7)
This operation first checks whether the location uaddr
still contains the value val3. If not, the operation
fails with the error EAGAIN. Otherwise, the operation [...]

https://man7.org/linux/man-pages/man2/futex.2.html

PR kern/56828: futex calls in Linux emulation sometimes hang
 1.8  18-Jan-2025  riastradh tests/lib/libc/sys/t_futex_ops: Fix another FUTEX_CMP_REQUEUE case.

PR kern/56828: futex calls in Linux emulation sometimes hang
 1.7  18-Jan-2025  riastradh tests/lib/libc/sys/t_futex_ops: Fix FUTEX_CMP_REQUEUE return values.

The return value is the number of waiters woken _or requeued_, not
just the number of waiters woken:

FUTEX_CMP_REQUEUE
Returns the total number of waiters that were woken up or
requeued to the futex for the futex word at uaddr2. If
this value is greater than val, then the difference is the
number of waiters requeued to the futex for the futex word
at uaddr2.

https://man7.org/linux/man-pages/man2/futex.2.html

PR kern/56828: futex calls in Linux emulation sometimes hang
 1.6  18-Jan-2025  riastradh tests/lib/libc/sys/t_futex_ops: Test FUTEX_CMP_REQUEUE edge case.

It must always compare the futex value and fail with EAGAIN on
mismatch, even if there are no waiters.

PR kern/56828: futex calls in Linux emulation sometimes hang
 1.5  06-May-2020  thorpej branches: 1.5.2; 1.5.8; 1.5.12;
Fix a bug in the futex_wake_highest_pri test case. Still fails as
expected.
 1.4  04-May-2020  thorpej Add a test case for PR kern/55230. It is currently marked as expect-fail.
 1.3  30-Apr-2020  thorpej - In uvm_voaddr_acquire(), take an extra hold on the anon lock obj.
- In uvm_voaddr_release(), if the anon ref count drops to 0, call
uvm_anfree() rather than uvm_anon_release(). Unconditionally drop
the anon lock, and release the extra hold on the anon lock obj.

Fixes a panic that occurs if the backing store for a futex backed by
an anon memory location is unmapped while a thread is waiting in the
futex.

Add a test case that reproduced the panic to verify that it's fixed.
 1.2  28-Apr-2020  riastradh Make FUTEX_WAIT_BITSET(bitset=0) fail with EINVAL to match Linux.
 1.1  26-Apr-2020  thorpej Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.5.12.1  02-Aug-2025  perseant Sync with HEAD
 1.5.8.2  07-Aug-2021  thorpej futex_wake_highest_pri is not expected to fail on the thorpej-futex2
branch.
 1.5.8.1  07-Aug-2021  thorpej Fix the unit test for FUTEX_REQUEUE and FUTEX_CMP_REQUEUE to account
for the different return value semantics.
 1.5.2.1  01-Nov-2020  thorpej - Re-factor the code that sets up real-time LWPs for various tests.
- Add tests for the RW_HANDOFF operations.

RSS XML Feed