git: sysctl - SMP performance work

Matthew Dillon dillon at crater.dragonflybsd.org
Sat Jun 6 16:23:06 PDT 2015


commit 6f1a15dc79a822710cc37e99f6a8bd9910e5e3f1
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sat Jun 6 16:17:41 2015 -0700

    sysctl - SMP performance work
    
    Performance work on the sysctl API.  Most accesses (including nearly all
    accesses made by libc) now use a shared lock, increasing concurrency in the
    exec path.
    
    * Acquire the sysctl global lock shared instead of exclusive for all normal
      accesses.  Use an exclusive lock for node and leaf creation or deletion.
      Ultimately we will move to a fine-grained model and remove the global lock.
    
    * Give each oid its own lockmgr lock.  Automatically acquire this lock
      shared for read access and exclusive for write access.  This retains
      just enough serialization of modifying (individual) sysctls to make
      sense to programmers.
    
    * Supply flag overrides to force shared or exclusive use.  Force a shared
      oid lock for name2oid(), allowing the sysctlbyname() path to nominally
      use a shared lock.

Summary of changes:
 sys/kern/kern_sysctl.c | 71 ++++++++++++++++++++++++++++++++------------------
 sys/sys/sysctl.h       |  9 +++++++
 2 files changed, 54 insertions(+), 26 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6f1a15dc79a822710cc37e99f6a8bd9910e5e3f1


-- 
DragonFly BSD source repository



More information about the Commits mailing list