git: kernel - Carefully refactor contended tokens and spinlocks

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Apr 22 19:31:33 PDT 2018


commit cc705b823a33a247956d2a54a4e929a0ca2936d9
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Apr 22 18:56:14 2018 -0700

    kernel - Carefully refactor contended tokens and spinlocks
    
    * Carefully put the exponential backoff back in for spinlocks, and
      implement for tokens.  Only applicable to exclusive locks, capped
      via sysctl (mjg).  Tested on dual-socket xeon.
    
    * Exclusive priority for shared locks reduces the shared/exclusive
      starvation that can occur when exclusive locks use exponential
      backoff.
    
    * Exponential backoff significantly improves performance for
      heavily contended exclusive locks by allowing some degree of burst
      operation.
    
    * Implement TSC windowing for shared locks (and a little for
      exclusive locks too).  This prevents heavily contended exclusive
      locks from completely starving shared locks by using windowing
      to disable the exclusive-priority mechanic for shared locks.
    
      This allows a few contending shared locks to compete on equal
      ground with exclusive locks.
    
    Suggested-by: mjg

Summary of changes:
 sys/kern/kern_spinlock.c | 122 +++++++++++++++++++++++++----------------------
 sys/kern/lwkt_token.c    |  70 +++++++++++++++++++--------
 2 files changed, 117 insertions(+), 75 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/cc705b823a33a247956d2a54a4e929a0ca2936d9


-- 
DragonFly BSD source repository



More information about the Commits mailing list