git: kernel - Performance tuning

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Nov 8 21:07:06 PST 2013


commit 12cdc371fb859682eda7d1c26c5059920a7cf118
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Nov 8 20:59:32 2013 -0800

    kernel - Performance tuning
    
    * Use a shared lock in the exec*() code, open, close, chdir, fchdir,
      access, stat, and readlink.
    
    * Adjust nlookup() to allow the last namecache record in a path to be
      locked shared if it is already resolved, and the caller requests it.
    
    * Remove nearly all global locks from critical dsched paths.  Defer
      creation of the tdio until an I/O actually occurs (huge savings in
      the fork/exit paths).
    
    * Improves fork/exec concurrency on monster of static binaries from
      14200/sec to 55000/sec+.  For dynamic binaries improve from around
      2500/sec to 9000/sec or so (48 cores fork/exec'ing different dynamic
      binaries).  For the same dynamic binary it's more around 5000/sec or
      so.
    
      Lots of issues here including the fact that all dynamic binaries load
      many shared resources, even hen the binaries are different programs.
      AKA libc.so.X and ld-elf.so.2, as well as /dev/urandom (from libc),
      and access numerous common path elements.
    
      Nearly all of these paths are now non-contending.  The major remaining
      contention is in per-vm_page/PMAP manipulation.  This is per-page and
      concurrent execs of the same program tend to pipeline so it isn't a
      big problem.

Summary of changes:
 sys/kern/imgact_elf.c                |  3 +-
 sys/kern/kern_dsched.c               | 83 ++++++++++++++++--------------------
 sys/kern/kern_exec.c                 |  3 +-
 sys/kern/vfs_cache.c                 |  6 ++-
 sys/kern/vfs_default.c               |  8 ++--
 sys/kern/vfs_nlookup.c               | 57 +++++++++++++++++--------
 sys/kern/vfs_syscalls.c              | 19 ++++++---
 sys/kern/vfs_vnops.c                 | 22 ++++++++--
 sys/sys/dsched.h                     |  3 --
 sys/sys/nlookup.h                    |  2 +-
 sys/vfs/deadfs/dead_vnops.c          |  5 ++-
 sys/vfs/devfs/devfs_vnops.c          | 14 ++++--
 sys/vfs/dirfs/dirfs_vnops.c          |  1 +
 sys/vfs/hammer/hammer_ondisk.c       |  6 +++
 sys/vfs/hammer/hammer_volume.c       |  2 +
 sys/vfs/hammer2/hammer2_vfsops.c     |  2 +
 sys/vfs/hpfs/hpfs_vfsops.c           |  4 ++
 sys/vfs/isofs/cd9660/cd9660_vfsops.c |  9 +++-
 sys/vfs/msdosfs/msdosfs_vfsops.c     |  6 +++
 sys/vfs/nfs/nfs_vnops.c              |  2 +
 sys/vfs/ntfs/ntfs_vfsops.c           |  5 ++-
 sys/vfs/nwfs/nwfs_vnops.c            |  2 +
 sys/vfs/procfs/procfs_vnops.c        |  5 +++
 sys/vfs/puffs/puffs_vnops.c          |  2 +
 sys/vfs/smbfs/smbfs_vnops.c          |  1 +
 sys/vfs/udf/udf_vfsops.c             |  7 ++-
 sys/vfs/ufs/ffs_vfsops.c             |  4 ++
 sys/vfs/union/union_subr.c           |  6 ++-
 sys/vfs/union/union_vnops.c          |  1 +
 29 files changed, 198 insertions(+), 92 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/12cdc371fb859682eda7d1c26c5059920a7cf118


-- 
DragonFly BSD source repository



More information about the Commits mailing list