Page MenuHomeFreeBSD

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

Authored by olce on Mon, May 12, 7:04 PM.
Tags
None
Referenced Files
F117998578: D50314.id155350.diff
Sun, May 25, 3:43 AM
F117985418: D50314.id.diff
Sun, May 25, 1:15 AM
Unknown Object (File)
Sat, May 24, 9:53 AM
Unknown Object (File)
Sat, May 24, 9:50 AM
Unknown Object (File)
Sat, May 24, 5:39 AM
Unknown Object (File)
Wed, May 21, 1:10 AM
Unknown Object (File)
Sun, May 18, 6:01 PM
Unknown Object (File)
Sun, May 18, 5:52 AM

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64108
Build 60992: arc lint + arc unit

Event Timeline

olce requested review of this revision.Mon, May 12, 7:04 PM

An alternative to D50125 and D50311. Given the current automatic tuning numbers, though, I don't think raising the number of vnodes is necessary, I'd go for D50311 (lowering kern.maxfiles) rather than this one, as I suspect it is well enough for today's machines and software. The change here is just the most conservative, while ensuring that the number of files remains lower then the number of vnodes by default (but here, contrary to D50125, the administrator is still free to override that).

This revision was not accepted when it landed; it landed in state Needs Review.Thu, May 15, 3:57 PM
This revision was automatically updated to reflect the committed changes.