Now
thorpej-futex commitmail json YAML
src/sys/kern/sys_futex.c@1.11.2.1
/
diff
/
nxr@1.11.2.1
src/sys/sys/lwp.h@1.212.2.1 / diff / nxr@1.212.2.1
src/sys/sys/lwp.h@1.212.2.1 / diff / nxr@1.212.2.1
Major overfaul of futex implemention:
- Use sleepqs directly, rather than using condition variables and
separate wait queues / strutures. By doing this, and using the
standard mechanism for keeping sleepqs sorted by priority, we
acn ensure that the highest priority waiters will be awakened,
rather than naively awakening in FIFO order.
- As part of the data structure re-organization, struct lwp gains
"l_futex" (the futex an LWP is blocked on) and "l_futex_wakesel"
(the futex wake selector bitset) fields (and loses l___rsvd1).
Plese note the special locking considerations for these fields
documented in the comments.
- Add the notion of a "futex class". This is prep work for eventually
supporting the FUTEX_*_PI operations, as well as some future NetBSD
extensions to the futex interface.
- Add a preliminary implementation of the first of those NetBSD extensions,
FUTEX_NETBSD_RW_WAIT and FUTEX_NETBSD_RW_HANDOFF. These are designed
to implement reader/writer locks with direct-handoff to the correct
priority thread(s) (real-time read-waiters need to have priority over
non-real-time write-waiters). NOTE: this is currently disabled due to
a mysterious panic that haasn't yet been tracked down.
- Add some SDT probes to aid in debugging.
- Use sleepqs directly, rather than using condition variables and
separate wait queues / strutures. By doing this, and using the
standard mechanism for keeping sleepqs sorted by priority, we
acn ensure that the highest priority waiters will be awakened,
rather than naively awakening in FIFO order.
- As part of the data structure re-organization, struct lwp gains
"l_futex" (the futex an LWP is blocked on) and "l_futex_wakesel"
(the futex wake selector bitset) fields (and loses l___rsvd1).
Plese note the special locking considerations for these fields
documented in the comments.
- Add the notion of a "futex class". This is prep work for eventually
supporting the FUTEX_*_PI operations, as well as some future NetBSD
extensions to the futex interface.
- Add a preliminary implementation of the first of those NetBSD extensions,
FUTEX_NETBSD_RW_WAIT and FUTEX_NETBSD_RW_HANDOFF. These are designed
to implement reader/writer locks with direct-handoff to the correct
priority thread(s) (real-time read-waiters need to have priority over
non-real-time write-waiters). NOTE: this is currently disabled due to
a mysterious panic that haasn't yet been tracked down.
- Add some SDT probes to aid in debugging.