HomeFreeBSD

MFC r191719:
rS193152Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

MFC r191719:

Reimplement futexes.
Old implemention used Giant to protect the kernel data structures,
but at the same time called malloc(M_WAITOK), that could cause the
calling thread to sleep and lost Giant protection. User-visible
result was the missed wakeup.

New implementation uses one sx lock per futex. The sx protects
the futex structures and allows to sleep while copyin or copyout
are performed.

Unlike linux, we return EINVAL when FUTEX_CMP_REQUEUE operation
is requested and either caller specified futexes are equial or
second futex already exists. This is acceptable since the situation
can only occur from the application error, and glibc falls back to
old FUTEX_WAKE operation when FUTEX_CMP_REQUEUE returns an error.

Approved by: kib (mentor)

Details

Provenance
dchaginAuthored on
Parents
rS193151: Tag the 9.6.1rc1 release
Branches
Unknown
Tags
Unknown

Event Timeline