Page MenuHomeFreeBSD

tmpfs: turn vfs.tmpfs.memory_percent into CTLFLAG_RWTUN
ClosedPublic

Authored by khng on Apr 10 2025, 6:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 16, 10:09 AM
Unknown Object (File)
Wed, Jan 14, 5:02 AM
Unknown Object (File)
Mon, Jan 12, 8:02 PM
Unknown Object (File)
Sat, Jan 10, 5:11 AM
Unknown Object (File)
Tue, Jan 6, 2:21 PM
Unknown Object (File)
Sat, Dec 27, 5:50 AM
Unknown Object (File)
Dec 14 2025, 1:14 PM
Unknown Object (File)
Dec 11 2025, 6:57 PM
Subscribers

Details

Summary

So sysctl is not the only way to set the value of this knob, this can be
set by loader tunables as well.

Sponsored by: Juniper Networks, Inc.
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

khng requested review of this revision.Apr 10 2025, 6:47 PM
markj added inline comments.
sys/fs/tmpfs/tmpfs_subr.c
447

Does it really work? sysctl_mem_percent() calls tmpfs_set_reserve_from_percent(), which uses tmpfs_pages_avail_init, which is initialized at SI_SUB_VFS, after SI_SUB_TUNABLES. Hmm, I guess it's okay since tmpfs_init() will call tmpfs_set_reserve_from_percent() again.

This revision is now accepted and ready to land.Apr 10 2025, 7:02 PM
sys/fs/tmpfs/tmpfs_subr.c
447

Yep. tmpfs_init() will be called again in this case.