freebsd-dev/sys/dev
Alfred Perlstein 85f190e4d1 Fixes to make select/poll mpsafe.
Problem:
  selwakeup required calling pfind which would cause lock order
  reversals with the allproc_lock and the per-process filedesc lock.
Solution:
  Instead of recording the pid of the select()'ing process into the
  selinfo structure, actually record a pointer to the thread.  To
  avoid dereferencing a bad address all the selinfo structures that
  are in use by a thread are kept in a list hung off the thread
  (protected by sellock).  When a selwakeup occurs the selinfo is
  removed from that threads list, it is also removed on the way out
  of select or poll where the thread will traverse its list removing
  all the selinfos from its own list.

Problem:
  Previously the PROC_LOCK was used to provide the mutual exclusion
  needed to ensure proper locking, this couldn't work because there
  was a single condvar used for select and poll and condvars can
  only be used with a single mutex.
Solution:
  Introduce a global mutex 'sellock' which is used to provide mutual
  exclusion when recording events to wait on as well as performing
  notification when an event occurs.

Interesting note:
  schedlock is required to manipulate the per-thread TDF_SELECT
  flag, however if given its own field it would not need schedlock,
  also because TDF_SELECT is only manipulated under sellock one
  doesn't actually use schedlock for syncronization, only to protect
  against corruption.

Proc locks are no longer used in select/poll.

Portions contributed by: davidc
2002-03-14 01:32:30 +00:00
..
aac Add ID's for a couple of upcoming cards. 2002-02-13 07:44:43 +00:00
acpica Only i386 has wbinvd(). 2002-03-12 09:45:17 +00:00
advansys Restore I/O port resources to the condition before adv_isa_probe() is 2001-05-06 09:28:18 +00:00
agp Correctly identify the Intel 82830 AGP bridge. 2002-02-05 23:13:25 +00:00
aha Turn on interrupt-entropy harvesting for all/any mass storage devices 2001-03-01 17:09:09 +00:00
ahb Turn on interrupt-entropy harvesting for all/any mass storage devices 2001-03-01 17:09:09 +00:00
aic Back out the hack from rev 1.13 that was done to initiate a bus rescan 2002-01-17 20:34:58 +00:00
aic7xxx Due to changes in the handling of the #line directive by GCC(cpp) 3.1, 2002-03-11 06:45:31 +00:00
amd Move unused functions into #if 0 ... #endif. 2001-05-06 08:07:10 +00:00
amr Staticise the amr devclass. 2002-01-08 06:47:02 +00:00
an In ad-hoc mode, the "associate" bit is valid to check to see if it is 2002-02-26 05:43:05 +00:00
ar Move the isa parts to a separate file. 2001-04-16 13:20:39 +00:00
asr If we're going to ifdef out the only reference to asr_drvinit, then 2002-02-26 03:22:44 +00:00
ata Add new support for locking an ATA channel and use that throughout 2002-03-11 21:04:32 +00:00
atkbdc Fixes to make select/poll mpsafe. 2002-03-14 01:32:30 +00:00
awi Set ifp->if_name to "awi" instead of device_get_name(dev) to avoid 2002-02-26 20:09:19 +00:00
bge Remove mbuf exhaustion warning messages; these are handled by the 2002-02-11 23:29:15 +00:00
bktr Fixes to make select/poll mpsafe. 2002-03-14 01:32:30 +00:00
buslogic Use ANSI C string contatenation instead of a multi-line string literal. 2001-12-13 11:14:28 +00:00
cardbus Cleanup the recent cardbus cleanups. This fixes some of the panics 2002-03-13 05:38:19 +00:00
ccd Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
ciss Fix warning; line 1640: ciss_abort_request defined but not used. 2001-12-18 08:01:48 +00:00
cm - generic Arcnet framework 2002-01-08 20:03:13 +00:00
cnw Get rid of the twisted MFREE() macro entirely. 2002-02-05 02:00:56 +00:00
cs Migrate to PCMCIA_CARD() macros 2001-11-15 07:52:49 +00:00
ct Added Logitec LHA-301 pnp id. 2001-10-09 15:30:19 +00:00
cy Initialize a variable bogusly to avoid a gcc bug that causes a spurious 2002-02-26 17:04:29 +00:00
dc Forgot one part of the VLAN support for the dc(4) driver. 2002-01-16 21:34:11 +00:00
de No FreeBSD/vax here either. 2001-11-03 08:32:28 +00:00
dec Introduce a boot environment variable (clock_compat_osf1) which can 2001-11-03 17:22:50 +00:00
dgb Repair some warnings. These are accessing idle portions of shared memory 2002-02-27 23:43:19 +00:00
digi Fix warnings. The driver would be more useful with a DRIVER_MODULE() 2002-02-27 23:47:45 +00:00
dpt Fix a couple of bogus enums. 2002-01-08 06:47:55 +00:00
ed Add EDIMAX ethernet card for NEWCARD from NetBSD 2002-01-29 07:08:56 +00:00
eisa Unbreak EISA. The PCI-EISA bridge bus is named eisab', not isab'. 2001-02-09 16:33:53 +00:00
em - Added support for receive in multiple 2002-02-13 18:19:27 +00:00
en Lock down the network interface queues. The queue mutex must be obtained 2000-11-25 07:35:38 +00:00
ep Two fixes from Jonathan Hanna: 2002-02-12 05:32:58 +00:00
ex Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
exca Default debugging to OFF now. 2002-02-04 15:55:21 +00:00
fb Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
fdc Disksort will not "munge" requests, BIO_ORDERED or not, so remove 2002-02-22 09:14:06 +00:00
fe Supported C-NET(98)P2 PnP mode. 2002-02-04 14:01:27 +00:00
fxp Remove mbuf exhaustion warning messages; these are handled by the 2002-02-04 03:15:27 +00:00
gem Use the pci_enable_* functions instead of manually fiddling with the 2002-03-11 02:37:19 +00:00
gfb We need to operate on struct thread now, not struct proc. 2001-11-08 01:49:06 +00:00
gx Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the 2001-12-03 17:28:27 +00:00
hea Fix warnings 2002-02-27 23:53:02 +00:00
hfa Applied the patch to fix HARP ATM that was broken when KAME IPv6 came 2001-06-20 17:09:14 +00:00
hme Use the pci_enable_* functions instead of manually fiddling with the 2002-03-11 02:37:19 +00:00
ic Oops, forgot to commit one file in the fd driver mega update. Here it 2001-12-16 07:52:13 +00:00
ichsmb Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ida Fix a signed bug in the crashdump code for systems with > 2GB of ram. 2001-11-13 01:08:54 +00:00
ie Repo copy i82586.h to dev/ic/i82586.h. 2001-07-02 05:29:58 +00:00
iicbus Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
iir Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
isp Disable RIO (reduced interrupt operation) for 2200 boards- it seemed like 2002-03-07 17:32:45 +00:00
ispfw Roll to latest production level firmware. 2002-01-23 06:42:54 +00:00
joy Revert change that breaks the joy module. joydevclass must not be static. 2002-01-08 18:27:49 +00:00
kbd Fixes to make select/poll mpsafe. 2002-03-14 01:32:30 +00:00
lge Do not call mii_polltick() immediately after mii_tick(). 2001-09-29 19:31:29 +00:00
lmc Fix typo: seperate -> separate. 2001-02-06 11:21:58 +00:00
lnc Get rid of the twisted MFREE() macro entirely. 2002-02-05 02:00:56 +00:00
mc146818
mca - Remove an unused write_ivars function that didn't do anything anyway. 2001-01-19 09:29:34 +00:00
mcd Don't call cdevsw_add(). 2001-11-04 08:58:22 +00:00
md Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
mii Remove problematic PHY_WRITE so that autoneg to 10 Mbps 2002-02-27 02:11:34 +00:00
mlx Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
mly Fix warnings (comment out unused tables that are taking space in the 2002-02-27 23:57:18 +00:00
mse KSE Milestone 2 2001-09-12 08:38:13 +00:00
musycc Fix warnings: 2001-06-15 00:19:43 +00:00
ncv Staticise a couple of debugging variables. 2002-01-08 19:37:12 +00:00
nge Remove errors in LINT (now that they are fatal) 2002-02-27 02:21:43 +00:00
nmdm Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
nsp o Add KLD support for scsi_low. 2001-12-15 12:32:23 +00:00
null Send the remains (such as I have located) of "block major numbers" to 2001-03-26 12:41:29 +00:00
ofw Move the make_dev call from the cn_probe to a sysinit that runs at 2002-01-09 04:03:55 +00:00
pccard Make hw.pccard.debug and hw.pccard.cis_debug tunable/sysctl. Setting to 1 2002-03-07 08:03:53 +00:00
pccbb Check the status of the card bridge first thing, rather than last in 2002-02-20 16:20:27 +00:00
pcf Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
pci Add 5th parameter to pci_read_device specifying the size of the object 2002-03-13 16:32:11 +00:00
pcic Fix missing comma in previous commit. 2001-12-28 23:51:48 +00:00
pdq Fix warning (passing wrong arg to arp_ifinit()) 2002-02-27 23:28:57 +00:00
ppbus Make this driver a better citizen by moving dev creation and 2001-12-19 19:37:31 +00:00
ppc Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
puc Remove the #if __FreeBSD_version glue now that the puc driver is part of 2002-03-08 17:41:22 +00:00
random Provide infrastructure for harvesting SWI entropy. 2002-03-03 20:09:42 +00:00
ray Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
rc Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
rp #include "opt_compat.h" so that the support for old ioctls can actually 2002-02-15 08:28:34 +00:00
sbni Rename a variable that might accidentally be duplicated elsewhere. 2002-01-08 19:36:54 +00:00
scd Don't call cdevsw_add() 2001-11-04 08:54:15 +00:00
sf Remove printf's on mbuf/cluster allocation failures. There are now 2001-12-14 05:56:35 +00:00
si KSE Milestone 2 2001-09-12 08:38:13 +00:00
sio Add pc98 support. 2002-03-08 12:41:32 +00:00
sk Remove printf's on mbuf/cluster allocation failures. There are now 2001-12-14 05:56:35 +00:00
smbus SMBus support for the AMD 756 power management unit. See smbus(4), 2001-09-16 22:35:07 +00:00
sn Migrate to PCMCIA_CARD() macros 2001-11-15 07:52:49 +00:00
snc Convert if_multiaddrs from LIST to TAILQ so that it can be traversed 2001-02-06 10:12:15 +00:00
snp Fixes to make select/poll mpsafe. 2002-03-14 01:32:30 +00:00
sound Fixes to make select/poll mpsafe. 2002-03-14 01:32:30 +00:00
speaker Add missing destroy_dev(). 2002-01-23 01:11:52 +00:00
sr Fix clock selection for X.21 interfaces. 2001-02-26 16:30:02 +00:00
stg Staticise a couple of debugging variables. 2002-01-08 19:37:12 +00:00
streams Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
sym Comment tokens after #undef <macroname> and #endif. 2001-12-13 11:12:30 +00:00
syscons Fixed compilation warnings. 2002-03-06 08:55:34 +00:00
tdfx Replace ffind_* with fget calls. 2002-01-14 00:13:45 +00:00
tga Add the TGA video driver. This is a great accomplishtment and will help 2001-11-01 08:26:30 +00:00
ti Remove mbuf exhaustion warning messages; these are handled by the 2002-02-11 23:38:30 +00:00
twe Update for the 6.9 firmware family (6xxx controllers), as well as for 2002-03-07 09:55:41 +00:00
tx Remove mbuf exhaustion warning messages; these are handled by the 2002-02-11 23:38:30 +00:00
txp Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the 2001-12-03 17:28:27 +00:00
usb Fixes to make select/poll mpsafe. 2002-03-14 01:32:30 +00:00
vinum GC: BIO_ORDERED going away. 2002-02-22 09:18:46 +00:00
vr Remove printf's on mbuf/cluster allocation failures. There are now 2001-12-14 05:56:35 +00:00
vx Get rid of the twisted MFREE() macro entirely. 2002-02-05 02:00:56 +00:00
wds Turn on interrupt-entropy harvesting for all/any mass storage devices 2001-03-01 17:09:09 +00:00
wi Add support for 3Com Airconnect PCI cards. 2002-03-11 23:29:59 +00:00
wl Remove support for FreeBSD 2.x from this driver. 2002-02-27 23:34:02 +00:00
xe Remove an unused variable. 2002-02-26 03:37:35 +00:00