git: kernel - Fix cpu/token starvation, vfs_busy deadlocks. incls sysctl

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Feb 20 18:46:06 PST 2013


commit ace53c28c58d56456136ef9cb4c6e97495d965fb
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Feb 20 18:38:33 2013 -0800

    kernel - Fix cpu/token starvation, vfs_busy deadlocks. incls sysctl
    
    * Remove the mplock around the userland sysctl system call, it should no
      longer be needed.
    
    * Remove the mplock around getcwd(), it should no longer be needed.
    
    * Change the vfs_busy(), sys_mount(), and related mount code to use the
      per-mount token instead of the mp lock.
    
    * Fix a race in vfs_busy() which could cause it to never get woken up.
    
    * Fix a deadlock in nlookup() when the lookup is racing an unmount.  When
      the mp is flagged MNTK_UNMOUNT, the unmount is in progress and the lookup
      must fail instead of loop.
    
    * per-mount token now protects mp->mnt_kern_flag.
    
    * unmount code now waits for final mnt_refs to return to the proper value,
      fixing races with other code that might temporarily ref the mount point.
    
    * Add lwkt_yield()'s in nvtruncbuf*() and nvnode_pager_setsize(), reducing
      cpu stalls due to large file-extending I/O's.  Also in tmpfs.
    
    * Use a marker in the vm_meter code and check for vmobj_token collisions.
      When a collision is detected, give other threads a chance to take the
      token.  This prevents hogging of this very important token.
    
    Testing-by: dillon, vsrinivas, ftigeot

Summary of changes:
 sys/kern/kern_sysctl.c       |  2 --
 sys/kern/vfs_cache.c         |  2 --
 sys/kern/vfs_mount.c         |  4 ++++
 sys/kern/vfs_nlookup.c       | 13 +++++++++++--
 sys/kern/vfs_syscalls.c      | 39 +++++++++++++++++++++++++++++++++------
 sys/kern/vfs_vm.c            |  4 ++++
 sys/vfs/tmpfs/tmpfs_vfsops.c |  3 +++
 sys/vm/vm_meter.c            | 26 ++++++++++++++++++++++++++
 8 files changed, 81 insertions(+), 12 deletions(-)

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


-- 
DragonFly BSD source repository



More information about the Commits mailing list