HomeFreeBSD

vfs: vntblinit(): Raise default 'kern.maxvnodes' higher than 'kern.maxfiles'

Description

vfs: vntblinit(): Raise default 'kern.maxvnodes' higher than 'kern.maxfiles'

Having 'kern.maxvnodes' higher than 'kern.maxfiles' mitigates a scenario
where some processes can eat up all vnodes in the system, causing
a deadlock, as long as the kernel itself does not create too many vnodes
without creating some file descriptor in some process' FD table. A very
small percentage (~0.6%) of excess vnodes at infinity, coupled with
a large difference near the origin, should cover basic cases more than
enough. Note however that this measure can be defeated, e.g., by using
nullfs mounts with non-trivial file hierarchies.

MFC after: 5 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50314

Details

Provenance
olceAuthored on May 12 2025, 12:19 PM
Differential Revision
D50314: vfs: vntblinit(): Raise default 'kern.maxvnodes' higher than 'kern.maxfiles'
Parents
rGebeeeae67845: subr_devmap: Implement pmap_mapdev with pmap_mapdev_attr
Branches
Unknown
Tags
Unknown