git: kernel - per-thread fd cache, p_fd lock bypass

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


commit 359499301cb3e32b532c88c41e7df5a36111392a
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Apr 20 08:44:32 2018 -0700

    kernel - per-thread fd cache, p_fd lock bypass
    
    * Implement a per-thread (fd,fp) cache.  Cache hits can keep fp's
      in a held state (avoiding the need to fhold()/fdrop() the ref count),
      and bypasses the p_fd spinlock.  This allows the file pointer structure
      to generally be shared across cpu caches.
    
    * Can cache up to four descriptors in each thread, LRU.  This is the common
      case.  Highly threaded programs tend to focus work on a distinct
      file descriptors in each thread.
    
    * One file descriptor can be cached in up to four threads.  This is
      a significant limitation, though relatively uncommon.  On a cache miss
      the code drops into the normal shared p_fd spinlock lookup.

Summary of changes:
 sys/dev/disk/iscsi/initiator/iscsi.c |   4 +-
 sys/dev/disk/xdisk/xdisk.c           |   2 +-
 sys/kern/imgact_elf.c                |   5 +-
 sys/kern/kern_acl.c                  |  10 +-
 sys/kern/kern_checkpoint.c           |   9 +-
 sys/kern/kern_descrip.c              | 551 ++++++++++++++++++++++++++++++-----
 sys/kern/kern_event.c                |   7 +-
 sys/kern/kern_exit.c                 |   6 +
 sys/kern/subr_diskiocom.c            |   2 +-
 sys/kern/sys_generic.c               |  24 +-
 sys/kern/sys_mqueue.c                |   2 +-
 sys/kern/uipc_syscalls.c             |  72 +++--
 sys/kern/vfs_nlookup.c               |   3 +-
 sys/kern/vfs_syscalls.c              |  54 ++--
 sys/netproto/smb/smb_dev.c           |   2 +-
 sys/sys/filedesc.h                   |  18 +-
 sys/sys/thread.h                     |  18 +-
 sys/vfs/hammer2/hammer2_ioctl.c      |   2 +-
 sys/vfs/hammer2/hammer2_vfsops.c     |   2 +-
 sys/vfs/nfs/nfs_syscalls.c           |   2 +-
 sys/vm/vm_mmap.c                     |   4 +-
 21 files changed, 601 insertions(+), 198 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/359499301cb3e32b532c88c41e7df5a36111392a


-- 
DragonFly BSD source repository


More information about the Commits mailing list