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, May 15, 8:52 AM
Unknown Object (File)
Thu, May 14, 10:49 PM
Unknown Object (File)
Thu, May 14, 4:39 PM
Unknown Object (File)
Mon, May 11, 11:03 PM
Unknown Object (File)
Wed, May 6, 6:06 PM
Unknown Object (File)
Mon, Apr 27, 5:28 PM
Unknown Object (File)
Thu, Apr 23, 9:31 AM
Unknown Object (File)
Thu, Apr 23, 1:00 AM
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.