freebsd-skq/sys
mtm ed2409013e Fix umtx locking, for libthr, in the kernel.
1. There was a race condition between a thread unlocking
   a umtx and the thread contesting it. If the unlocking
   thread won the race it may try to wakeup a thread that
   was not yet in msleep(). The contesting thread would then
   go to sleep to await a wakeup that would never come. It's
   not possible to close the race by using a lock because
   calls to casuptr() may have to fault a page in from swap.
   Instead, the race was closed by introducing a flag that
   the unlocking thread will set when waking up a thread.
   The contesting thread will check for this flag before
   going to sleep. For now the flag is kept in td_flags,
   but it may be better to use some other member or create
   a new one because of the possible performance/contention
   issues of having to own sched_lock. Thanks to jhb for
   pointing me in the right direction on this one.

2. Once a umtx was contested all future locks and unlocks
   were happening in the kernel, regardless of whether it
   was contested or not. To prevent this from happening,
   when a thread locks a umtx it checks the queue for that
   umtx and unsets the contested bit if there are no other
   threads waiting on it. Again, this is slightly more
   complicated than it needs to be because we can't hold
   a lock across casuptr(). So, the thread has to check
   the queue again after unseting the bit, and reset the
   contested bit if it finds that another thread has put
   itself on the queue in the mean time.

3. Remove the if... block for unlocking an uncontested
   umtx, and replace it with a KASSERT. The _only_ time
   a thread should be unlocking a umtx in the kernel is
   if it is contested.
2003-07-17 11:06:40 +00:00
..
alpha Rename thread_siginfo to cpu_thread_siginfo. 2003-07-15 00:11:04 +00:00
amd64 Rename thread_siginfo to cpu_thread_siginfo. 2003-07-15 00:11:04 +00:00
arm sys/sys/limits.h: 2003-05-19 20:29:07 +00:00
boot Fix the ski loader, broken by the gcc upgrade. Update the linker 2003-07-17 01:49:59 +00:00
cam Merge common XPT_CALC_GEOMETRY functions into a single convenience function. 2003-06-14 22:17:41 +00:00
coda Remove in toto coda_strategy which incorrectly implemented vop_panic(); 2003-06-15 18:45:15 +00:00
compat Don't map LINUX_POSIX_VDISABLE to _POSIX_VDISABLE and vice versa for 2003-06-28 19:32:07 +00:00
conf make usb bus_dma aware. 2003-07-15 22:42:37 +00:00
contrib Fix the ACPI_DEBUG build for the non-module case. Move the #define into 2003-07-15 19:18:41 +00:00
crypto Use __FBSDID(). 2003-06-10 21:44:29 +00:00
ddb Rename P_THREADED to P_SA. P_SA means a process is using scheduler 2003-06-15 00:31:24 +00:00
dev seems like i386 && DIAGNOSTIC needs sys/proc.h 2003-07-16 08:15:02 +00:00
fs If bread() returns a zero-length buffer, as can happen after a 2003-07-03 14:54:47 +00:00
geom Handle geoms which are withering away specially in the dump functions. 2003-07-08 21:12:40 +00:00
gnu Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementations 2003-06-15 18:53:00 +00:00
i4b Mega busdma API commit. 2003-07-01 15:52:06 +00:00
i386 Rename thread_siginfo to cpu_thread_siginfo. 2003-07-15 00:11:04 +00:00
ia64 Rename thread_siginfo to cpu_thread_siginfo. 2003-07-15 04:43:33 +00:00
isa Add support for the A4 Tech RFSW-35 mouse wheel. Probe is similar to 2003-07-12 18:36:04 +00:00
isofs/cd9660 change dev_t to struct cdev * to match ufs. This fixes fstat for cd9660 2003-06-24 22:11:20 +00:00
kern Fix umtx locking, for libthr, in the kernel. 2003-07-17 11:06:40 +00:00
libkern Use __FBSDID(). 2003-06-11 05:37:42 +00:00
modules make usb bus_dma aware. 2003-07-15 22:42:37 +00:00
net Implement an utility function that can be used by device drivers to 2003-07-15 10:37:09 +00:00
net80211 insure ic_bss always has a "valid" channel; avoids problems where users could 2003-06-29 20:13:38 +00:00
netatalk
netatm Use __FBSDID(). 2003-06-11 07:22:30 +00:00
netgraph add missing machine/bus.h that is necessary to build now that usb is bus_dma 2003-07-16 03:43:14 +00:00
netinet Allow set 31 to be used for rules other than 65535. 2003-07-15 23:07:34 +00:00
netinet6 Do not attempt to access to inp_socket fields if the socket is in the TIME_WAIT 2003-06-17 00:31:30 +00:00
netipsec consolidate callback optimization check in one location by adding a flag 2003-06-30 05:09:32 +00:00
netipx Use __FBSDID(). 2003-06-11 05:37:42 +00:00
netkey Use __FBSDID(). 2003-06-11 05:37:42 +00:00
netnatm Instead of returning an error call the ioctl() handler of the interface 2003-07-15 15:51:50 +00:00
netncp Use __FBSDID(). 2003-06-11 05:37:42 +00:00
netsmb Add a f_vnode field to struct file. 2003-06-22 08:41:43 +00:00
nfs
nfsclient Change idle sleep indentifier to "-" for nfsiod 2003-07-02 08:09:20 +00:00
nfsserver Change idle state sleep identifier to "-" for nfsd. 2003-07-02 08:08:32 +00:00
opencrypto consolidate callback optimization check in one location by adding a flag 2003-06-30 05:09:32 +00:00
pc98 Rename thread_siginfo to cpu_thread_siginfo. 2003-07-15 00:11:04 +00:00
pccard OLDCARD is OBSOLETE_IN_6. Tag it as such. 2003-06-12 04:46:43 +00:00
pci Add support for the 8139C+ chipset. Unlike the other chips in the 8139 2003-07-10 20:38:48 +00:00
posix4 Use __FBSDID(). 2003-06-11 06:34:30 +00:00
powerpc Rename thread_siginfo to cpu_thread_siginfo. 2003-07-15 00:11:04 +00:00
rpc
security Remove trailing whitespace. 2003-07-05 01:24:36 +00:00
sparc64 change CLASS depending upon __ELF_WORD_SIZE. This is necessary if 2003-07-16 01:14:40 +00:00
sys Fix umtx locking, for libthr, in the kernel. 2003-07-17 11:06:40 +00:00
tools Don't check the state of the vnode interlock if the specification says 2003-06-22 21:20:06 +00:00
ufs We just cached the inode pointer, no need to call VTOI() again. 2003-07-04 12:16:33 +00:00
vm Avoid an unnecessary calculation: there is no need to subtract 2003-07-13 21:02:11 +00:00
Makefile Revert exclusion for amd64 that stopped boot/ being built. 2003-06-26 03:52:48 +00:00