sysctl - SMP performance work
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 6 Jun 2015 23:17:41 +0000 (16:17 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 6 Jun 2015 23:22:57 +0000 (16:22 -0700)
commit6f1a15dc79a822710cc37e99f6a8bd9910e5e3f1
tree12c032b6d6d00cc927b03fc0e107fccb69058f93
parent82bc37c32f55ca1cee22678a8ffe89cd3bcf2754
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.
sys/kern/kern_sysctl.c
sys/sys/sysctl.h