kernel - Reduce excessive inode hash table allocations
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 16 Oct 2016 21:31:40 +0000 (14:31 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 16 Oct 2016 21:35:03 +0000 (14:35 -0700)
commitfd74079f8d77551dc82099abf893060bf62f2ffb
tree7d512c7e5c9f41afcc6f89e13c713e03dddbbab3
parentb93d6cf83513ec3fab0596971508fb79232443f2
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.
14 files changed:
sys/gnu/vfs/ext2fs/ext2_ihash.c
sys/gnu/vfs/ext2fs/ext2_quota.c
sys/kern/vfs_cache.c
sys/kern/vfs_subr.c
sys/sys/vnode.h
sys/vfs/hpfs/hpfs_hash.c
sys/vfs/isofs/cd9660/cd9660_node.c
sys/vfs/msdosfs/msdosfs_denode.c
sys/vfs/nfs/nfs_node.c
sys/vfs/ntfs/ntfs_ihash.c
sys/vfs/smbfs/smbfs_vfsops.c
sys/vfs/ufs/ffs_softdep.c
sys/vfs/ufs/ufs_ihash.c
sys/vfs/ufs/ufs_quota.c