git: kernel - usched_dfly revamp (6), reimplement shared spinlocks & misc others

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Sep 24 18:27:54 PDT 2012


commit 0846e4ceea46414947a7162124a713ecf1cab19b
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Sep 24 18:24:22 2012 -0700

    kernel - usched_dfly revamp (6), reimplement shared spinlocks & misc others
    
    * Rename gd_spinlocks_wr to just gd_spinlocks.
    
    * Reimplement shared spinlocks and optimize the shared spinlock path.
      Contended exclusive spinlocks are less optimal with this change.
    
    * Use shared spinlocks for all file descriptor accesses.  This includes
      not only most IO calls like read() and write(), but also callbacks
      from kqueue to double-check the validity of a file descriptor.
    
    * Use getnanouptime() instead of nanouptime() in kqueue_sleep() and
      kern_kevent(), removing a hardware I/O serialization (to read the HPET)
      from the critical path.
    
    * These changes significantly reduce kernel spinlock contention when running
      postgres/pgbench benchmarks.

Summary of changes:
 sys/kern/kern_descrip.c       |   24 ++++----
 sys/kern/kern_event.c         |    4 +-
 sys/kern/kern_intr.c          |    4 +-
 sys/kern/kern_lock.c          |    6 +--
 sys/kern/kern_mutex.c         |    4 +-
 sys/kern/kern_spinlock.c      |  121 ++++++++++++++++++++++++++++++++++++++---
 sys/kern/lwkt_ipiq.c          |    2 +-
 sys/kern/lwkt_thread.c        |    8 ++--
 sys/kern/usched_bsd4.c        |    2 +-
 sys/kern/usched_dfly.c        |   15 ++++-
 sys/platform/pc32/isa/clock.c |    2 +-
 sys/platform/pc64/isa/clock.c |    2 +-
 sys/sys/globaldata.h          |    2 +-
 sys/sys/mutex2.h              |    6 +-
 sys/sys/spinlock.h            |    3 +
 sys/sys/spinlock2.h           |  108 ++++++++++++++++++++++++++++++++-----
 16 files changed, 253 insertions(+), 60 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0846e4ceea46414947a7162124a713ecf1cab19b


-- 
DragonFly BSD source repository


More information about the Commits mailing list