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)
Sat, May 17, 1:06 AM
Unknown Object (File)
Fri, May 9, 2:57 PM
Unknown Object (File)
Apr 30 2025, 7:15 PM
Unknown Object (File)
Apr 18 2025, 11:03 AM
Unknown Object (File)
Apr 18 2025, 11:02 AM
Unknown Object (File)
Apr 17 2025, 12:55 PM
Unknown Object (File)
Apr 12 2025, 11:04 AM
Unknown Object (File)
Apr 12 2025, 10:31 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.