git: kernel - Remove SMP bottlenecks on uidinfo, descriptors, and lockf

Matthew Dillon dillon at crater.dragonflybsd.org
Sat Apr 21 17:50:38 PDT 2018


commit d629916367683a6eed53be1506f361d512724496
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sat Apr 21 17:30:42 2018 -0700

    kernel - Remove SMP bottlenecks on uidinfo, descriptors, and lockf
    
    * Use an eventcounter and the per-thread fd cache to fix
      bottlenecks in checkfdclosed().  This will work well for
      the vast majority of applications and test benches.
    
    * Batch holdfp*() operations on kqueue collections when implementing
      poll() and select().  This significant improves performance.
      Full scaling not yet achieved, however.
    
    * Increase copyin item batching from 8 to 32 for select() and poll().
    
    * Give the uidinfo structure a pcpu array to hold the posixlocks
      and openfiles count fields, with a rollup contained in the uidinfo
      structure itself.
    
      This removes numerous global bottlenecks related to open(),
      close(), dup*(), and lockf operations (posixlocks count).
    
      ui_openfiles will force a rollup on limit reached to be sure
      that the limit was actually reached.  ui_posixlocks stays fairly
      loose.  Each cpu rolls up generally only when the pcpu count exceeds
      +32 or goes below -32.
    
    * Give the proc structure a pcpu array for the same counts, in order
      to properly support seteuid() and such.
    
    * Replace P_ADVLOCK with a char field proc->p_advlock_flag, and
      remove token operations around the field.

Summary of changes:
 sys/kern/kern_descrip.c  | 149 ++++++++++++++++++++++++-----------
 sys/kern/kern_event.c    | 198 ++++++++++++++++++++++++++++++++++++-----------
 sys/kern/kern_exit.c     |   3 +-
 sys/kern/kern_fork.c     |   2 +
 sys/kern/kern_lockf.c    |  44 +++++++----
 sys/kern/kern_resource.c |   6 +-
 sys/kern/sys_generic.c   |  17 ++--
 sys/sys/event.h          |   3 +-
 sys/sys/eventvar.h       |   2 +-
 sys/sys/file.h           |   3 +-
 sys/sys/filedesc.h       |   2 +
 sys/sys/proc.h           |   8 +-
 sys/sys/resourcevar.h    |  19 ++++-
 13 files changed, 334 insertions(+), 122 deletions(-)

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


-- 
DragonFly BSD source repository



More information about the Commits mailing list