kernel - Refactor kqueue interlocks
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 7 Sep 2010 01:44:03 +0000 (18:44 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 7 Sep 2010 01:44:03 +0000 (18:44 -0700)
commit4371bb25c4dc6be21df04e7de72b65682ca9f4c4
tree789bc819105675ade9b6c8396eff6a4004bea635
parente5104a66d763a1f801f6215d21ddd27ef36dd24d
kernel - Refactor kqueue interlocks

* Make KN_PROCESSING a soft lock flag.  When set nobody else can mess
  with a particular knote (other than setting certain flags) even if
  the originator blocks.

* Interlock major processing with KN_PROCESSING.  Registration, event
  scan, knote(), deletion, and filter ops.

* Block & restart when conflicts occur.  For the knote() hot-path we only
  block and restart if the 'hint' is non-zero, otherwise we just flag with
  KN_REPROCESS to indicate that reprocessing is required.

* This should fix kqueue races related to blocking operations confusing
  the list scan.

* Document the shit out of everything.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
sys/kern/kern_event.c
sys/sys/event.h