freebsd-skq/sys/dev/bktr
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
..
bktr_audio.c Upgrade to driver 2.18 2000-10-31 13:09:56 +00:00
bktr_audio.h
bktr_card.c Upgrade to driver 2.18 2000-10-31 13:09:56 +00:00
bktr_card.h Update to driver 2.13. 2000-06-26 09:41:32 +00:00
bktr_core.c Fixes to make select/poll mpsafe. 2002-03-14 01:32:30 +00:00
bktr_core.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
bktr_i2c.c Finish deprecating <sys/select.h> in favor of <sys/selinfo.h> in kernel code. 2001-01-20 02:24:07 +00:00
bktr_i2c.h Upgrade the bktr driver from 2.07 to 2.10. 2000-04-04 16:54:13 +00:00
bktr_mem.c o Add #include <sys/systm.h> to fix a warning about printf() being 2001-11-26 04:06:47 +00:00
bktr_mem.h Update to driver 2.15. 2000-09-10 14:34:08 +00:00
bktr_os.c Don't call cdevsw_add(). 2001-11-04 11:50:08 +00:00
bktr_os.h Modify the critical section API as follows: 2001-12-18 00:27:18 +00:00
bktr_reg.h Upgrade to driver 2.18 2000-10-31 13:09:56 +00:00
bktr_tuner.c Update to driver 2.17 2000-10-19 07:33:28 +00:00
bktr_tuner.h
CHANGELOG.TXT Upgrade to driver 2.18 2000-10-31 13:09:56 +00:00
ioctl_bt848.h Fix typo in comments 2000-10-31 14:30:29 +00:00
ioctl_meteor.h