git: kernel - Optimize vfs_msync() when MNTK_THR_SYNC is used

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Oct 11 00:06:05 PDT 2013


commit eddc656a4e9735e3069a4d449d65ff5bca9ac645
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Oct 10 23:13:22 2013 -0700

    kernel - Optimize vfs_msync() when MNTK_THR_SYNC is used
    
    * vfs_msync() will now use vsyncscan() when MNTK_THR_SYNC is set.
      Lazy synchronization scans will still properly ignore MADV_NOSYNC
      areas, but will not be able to optimize away the scan overhead for
      those vnodes (they remain on the syncer list).
    
      This change allows both lazy synchronization and explicit 'sync' commands
      to avoid having to scan all cached vnodes on the system, resulting in O(1)
      operation in many cases where it might have taken a few seconds before
      (on large systems with hundreds of thousands to millions of vnodes cached).
      With this change both the vnode sync and the memory sync will be optimal.
    
      Currently implemented for hammer1 and hammer2.
    
    * Add VOBJDIRTY to the set of flags that will place the vnode on the
      syncer list.  This occurs from the vm_page_dirty() and other bits of
      code only if MNTK_THR_SYNC is set.
    
      Theoretically it should be safe for us to do this even though neither
      the vm_object or the related vnode are likely locked or guarded, because
      neither can go away while an associated vm_page is busied.  The syncer
      list code itself is protected with a token.

Summary of changes:
 sys/kern/vfs_subr.c              | 21 +++++++++++++++------
 sys/kern/vfs_sync.c              |  2 +-
 sys/vfs/hammer2/hammer2_chain.c  |  2 ++
 sys/vfs/hammer2/hammer2_vfsops.c | 35 ++++++++++++-----------------------
 sys/vfs/hammer2/hammer2_vnops.c  | 21 +++++++++++++++++++++
 sys/vm/vm_object.c               | 13 +++++++++++--
 6 files changed, 62 insertions(+), 32 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list