git: kernel - Adjust vfs.nbuf, kern.maxvnodes, and debug.max_softdeps counts

Matthew Dillon dillon at
Tue Dec 5 20:23:11 PST 2017

commit e4f55ba263c00e15cf119e03b9af81cd218143e7
Author: Matthew Dillon <dillon at>
Date:   Tue Dec 5 20:11:51 2017 -0800

    kernel - Adjust vfs.nbuf, kern.maxvnodes, and debug.max_softdeps counts
    * Cap some system limits on machines with tons of memory.
    * vfs.nbuf is capped at roughly 350,000 buffer cache buffers.  This
      also caps buffer cache data to approximately 11G.
      The reason for this is to avoid wiring too much physical memory in
      the default configuration since programs might want to use the
      memory fo r other purposes.  Buffer cache buffers provide very fast
      access when reading data from cached vnodes, but the new KVABIO ABI
      will soon allow us to acquire and dispose of such buffers more
      efficiently, increasing the efficiency of accessing data cached via
      the block device and making long-term caching via vnode-backed
      buffers somewhat less important.
    * kern.maxvnodes is capped at approximately 3 million vnodes.  This
      can be set higher at run-time via a sysctl, if desired.
      NOTE: Our go-to filesystems are designed to or can be set to cache
    	file data via the block device instead of the vnode, which is
    	preferable on systems with lots of memory.  vnode caching is
    	still important, but a bit less so now than in prior years.
    * debug.max_softdeps is capped at 1000000, because even a million
      is an obscenely high value for softdep structures.

Summary of changes:
 sys/kern/vfs_subr.c                | 13 +++++++++++--
 sys/platform/pc64/x86_64/machdep.c | 18 ++++++++++++------
 sys/vfs/ufs/ffs_softdep.c          |  5 +++++
 3 files changed, 28 insertions(+), 8 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list