git: kernel - Reduce excessive inode hash table allocations

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Oct 16 14:38:08 PDT 2016


commit fd74079f8d77551dc82099abf893060bf62f2ffb
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Oct 16 14:31:40 2016 -0700

    kernel - Reduce excessive inode hash table allocations
    
    * Reduce excessive inode hash table allocations in various filesystems
      (primarily ufs).  Introduce vfs_inodehashsize() to calculate a reasonable
      hash table size instead of using 'maxvnodes'.
    
    * The new formula is to generally use maxvnodes / 2 (2 x stacking for the
      chained hash table).  When maxvnodes is large we use maxvnodes / 4, and
      if maxvnodes is very large (> 1M vnodes) we use maxvnodes / 8.  This
      significantly reduces the amount of kernel memory used when mounting
      ufs, ext2fs, hpfs, isofs, msdosfs, nfs, ntfs, and smbfs filesystems.

Summary of changes:
 sys/gnu/vfs/ext2fs/ext2_ihash.c    |  8 ++++----
 sys/gnu/vfs/ext2fs/ext2_quota.c    |  7 +++++--
 sys/kern/vfs_cache.c               | 10 ++++++++--
 sys/kern/vfs_subr.c                | 30 +++++++++++++++++++++++++++++-
 sys/sys/vnode.h                    |  1 +
 sys/vfs/hpfs/hpfs_hash.c           |  3 ++-
 sys/vfs/isofs/cd9660/cd9660_node.c | 13 ++++++++-----
 sys/vfs/msdosfs/msdosfs_denode.c   |  8 +++-----
 sys/vfs/nfs/nfs_node.c             |  7 +++++--
 sys/vfs/ntfs/ntfs_ihash.c          |  4 +++-
 sys/vfs/smbfs/smbfs_vfsops.c       |  5 ++++-
 sys/vfs/ufs/ffs_softdep.c          | 11 +++++++----
 sys/vfs/ufs/ufs_ihash.c            |  6 +-----
 sys/vfs/ufs/ufs_quota.c            |  4 +++-
 14 files changed, 83 insertions(+), 34 deletions(-)

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


-- 
DragonFly BSD source repository



More information about the Commits mailing list