git: kernel - Refactor kqueue interlocks

Matthew Dillon dillon at
Mon Sep 6 18:49:41 PDT 2010

commit 4371bb25c4dc6be21df04e7de72b65682ca9f4c4
Author: Matthew Dillon <dillon at>
Date:   Mon Sep 6 18:44:03 2010 -0700

    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 at>

Summary of changes:
 sys/kern/kern_event.c |  344 +++++++++++++++++++++++++++++++++++--------------
 sys/sys/event.h       |   18 ++-
 2 files changed, 255 insertions(+), 107 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list