freebsd-dev/sys
Ed Schouten af7e75f59d Add a futex implementation for CloudABI.
Summary:
CloudABI provides two different types of futex objects: read-write locks
and condition variables. There is no need to provide separate support
for once objects and thread joining, as these are efficiently simulated
by blocking on a read-write lock. Mutexes simply use read-write locks.

Condition variables always have a lock object associated to them. They
always know to which lock a thread needs to be migrated if woken up.
This allows us to implement requeueing. A broadcast on a condition
variable will never cause multiple threads to be woken up at once. They
will be woken up iteratively.

This implementation still has lots of room for improvement. Locking is
coarse and right now we use linked lists to store all of the locks and
condition variables, instead of using a hash table. The primary goal of
this implementation was to behave correctly. Performance will be
improved as we go.

Test Plan:
This futex implementation has been in use for the last couple of months
and seems to work pretty well. All of the cloudlibc and libc++ unit
tests seem to pass.

Reviewers: dchagin, kib, vangyzen

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D3148
2015-07-27 10:07:29 +00:00
..
amd64 Add a comment discussing the appropriate use of the atomic_*() functions 2015-07-24 19:43:18 +00:00
arm Fix color mapping for TDA19988. Values for VIP_CNTRL_1 and VIP_CNTRL_2 2015-07-25 03:19:02 +00:00
arm64 Teach the GICv2 driver about the Qualcomm GICv2 compatible string. 2015-07-21 18:08:10 +00:00
boot Use consistent spacing. 2015-07-25 20:17:19 +00:00
bsm
cam Refactor unmapped buffer address handling. 2015-07-23 19:13:41 +00:00
cddl Remove checks for a NULL return value from M_WAITOK allocations. 2015-07-21 23:44:36 +00:00
compat Add a futex implementation for CloudABI. 2015-07-27 10:07:29 +00:00
conf Merge ACPICA 20150717. 2015-07-22 16:25:07 +00:00
contrib Sync in latest upstream system call definitions. 2015-07-27 10:04:06 +00:00
crypto Complete the move that was started w/ r263218.. For some reason I 2015-07-11 03:12:34 +00:00
ddb Various changes to the registers displayed in DDB for x86. 2015-07-22 01:09:02 +00:00
dev o make sure the boundary is a power of 2, when not zero. 2015-07-26 16:39:37 +00:00
fs In tmpfs_chtimes(), remove checks on the nanosecond level when 2015-07-26 08:33:46 +00:00
gdb CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
geom Report the scheme and provider names in warning message about unaligned 2015-07-26 11:16:48 +00:00
gnu
i386 Remove duplicate and useless declarations. 2015-07-22 09:12:40 +00:00
isa
kern Build debug version of rmlock's methods only when LOCK_DEBUG > 0. 2015-07-26 10:53:32 +00:00
kgssapi
libkern Remove checks for __ARM_EABI__, we only build for EABI now. 2015-07-09 21:02:40 +00:00
mips Populate hw.model with the CPU model information. 2015-07-14 05:14:10 +00:00
modules isl(4), driver for Intersil I2C ISL29018 Digital Ambient Light Sensor 2015-07-25 20:17:19 +00:00
net Prevent null-pointer dereferencing. 2015-07-20 08:21:51 +00:00
net80211 Break out the current 802.11 software scan methods into an indirect table. 2015-06-08 02:35:43 +00:00
netgraph * Address review (and add a bit myself). 2015-07-12 18:14:38 +00:00
netinet Improve locking on Mac OS X. This does not change the functionality 2015-07-26 10:37:40 +00:00
netinet6 Move including netinet/icmp6.h around to avoid a problem when including 2015-07-25 18:26:09 +00:00
netipsec IPSEC, remove variable argument function its already due. 2015-07-21 21:46:24 +00:00
netnatm
netpfil Add helper functions for IP checksum adjusting. Use these functions in 2015-07-20 07:26:31 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Fix broken implementation of "kvasprintf()" function by adding missing 2015-07-03 11:16:20 +00:00
opencrypto Fix XTS, and name things a bit better... 2015-07-14 07:45:18 +00:00
pc98 Spell crypto correctly. 2015-07-14 10:47:56 +00:00
powerpc Implement the lockstat provider using SDT(9) instead of the custom provider 2015-07-19 22:14:09 +00:00
rpc
security fd: make 'rights' a manadatory argument to fget* functions 2015-07-05 19:05:16 +00:00
sparc64 o Revert the other functional half of r239864, i. e. the merge of r134227 2015-07-24 15:13:21 +00:00
sys Add RISC-V ELF machine type definition 2015-07-24 16:52:21 +00:00
teken
tools
ufs Refactor unmapped buffer address handling. 2015-07-23 19:13:41 +00:00
vm Revert r173708's modifications to vm_object_page_remove(). 2015-07-25 18:29:06 +00:00
x86 Typo in comment. 2015-07-20 19:51:41 +00:00
xdr
xen Garbage collect comments which related to the pre-r284296 support for a 2015-06-21 06:05:33 +00:00
Makefile Kill EoL whitespace. 2015-05-29 14:03:07 +00:00