git: kernel - Use pool tokens to protect unix domain PCBs

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Sep 14 09:14:25 PDT 2012


commit 524d0e3c7c3041d91aaa8a6f0d1efa4623c0f413
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Sep 14 09:10:06 2012 -0700

    kernel - Use pool tokens to protect unix domain PCBs
    
    * The read, status, and write paths now use per-pcb pool tokens
      instead of the global unp_token.  The global token is still used
      for accept, connect, disconnect, etc.
    
    * General semantics for making this SMP safe is to obtain a pointer
      to the unp from so->so_pcb, then obtain the related pool token,
      then re-check that so->so_pcb still equals unp.
    
    * Pool token protects the peer pointer, unp->unp_conn.  Any change
      to unp->unp_conn requires both the pool token and the global token.
    
    * This should improve concurrent reading and writing w/unix domain
      sockets.

Summary of changes:
 sys/kern/uipc_usrreq.c |  179 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 141 insertions(+), 38 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/524d0e3c7c3041d91aaa8a6f0d1efa4623c0f413


-- 
DragonFly BSD source repository


More information about the Commits mailing list