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, Oct 11, 12:01 AM
Unknown Object (File)
Thu, Oct 9, 7:46 PM
Unknown Object (File)
Fri, Oct 3, 11:37 AM
Unknown Object (File)
Thu, Oct 2, 12:06 AM
Unknown Object (File)
Wed, Oct 1, 1:56 PM
Unknown Object (File)
Thu, Sep 25, 7:49 PM
Unknown Object (File)
Sep 9 2025, 2:48 PM
Unknown Object (File)
Sep 6 2025, 12:25 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.