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)
Thu, Sep 25, 7:49 PM
Unknown Object (File)
Tue, Sep 9, 2:48 PM
Unknown Object (File)
Sat, Sep 6, 12:25 AM
Unknown Object (File)
Tue, Sep 2, 4:30 PM
Unknown Object (File)
Aug 26 2025, 2:45 AM
Unknown Object (File)
Aug 26 2025, 2:12 AM
Unknown Object (File)
Aug 26 2025, 12:51 AM
Unknown Object (File)
Aug 15 2025, 12:17 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.