aboutsummaryrefslogtreecommitdiff
path: root/share/man/man5/tmpfs.5
diff options
context:
space:
mode:
Diffstat (limited to 'share/man/man5/tmpfs.5')
-rw-r--r--share/man/man5/tmpfs.5100
1 files changed, 75 insertions, 25 deletions
diff --git a/share/man/man5/tmpfs.5 b/share/man/man5/tmpfs.5
index 84b394da6210..f3d6a2f6c2b5 100644
--- a/share/man/man5/tmpfs.5
+++ b/share/man/man5/tmpfs.5
@@ -51,9 +51,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd September 8, 2017
+.Dd September 18, 2023
.Dt TMPFS 5
.Os
.Sh NAME
@@ -77,7 +75,7 @@ tmpfs_load="YES"
The
.Nm
driver implements an in-memory, or
-.Tn tmpfs
+.Nm
file system.
The filesystem stores both file metadata and data in main memory.
This allows very fast and low latency accesses to the data.
@@ -87,8 +85,9 @@ These properties make the filesystem's mounts suitable for fast
scratch storage, like
.Pa /tmp .
.Pp
-If the system becomes low on memory and swap is configured (see
-.Xr swapon 8 ),
+If the system becomes low on memory and swap is configured
+.Po see
+.Xr swapon 8 Pc ,
the system can transfer file data to swap space, freeing memory
for other needs.
Metadata, including the directory content, is never swapped out by the
@@ -109,43 +108,94 @@ The following options are available when
mounting
.Nm
file systems:
-.Bl -tag -width "It Cm maxfilesize"
+.Bl -tag -width "maxfilesize"
+.It Cm easize
+Set the maximum memory size used by extended attributes in bytes.
+The default is 16 megabytes.
+.It Cm export
+Accept the
+.Cm export
+option for compatibility with
+.Xr nfsv4 4 .
+This option does nothing.
.It Cm gid
-Specifies the group ID of the root inode of the file system.
-Defaults to the mount point's GID.
-.It Cm uid
-Specifies the user ID of the root inode of the file system.
-Defaults to the mount point's UID.
-.It Cm mode
-Specifies the mode (in octal notation) of the root inode of the file system.
-Defaults to the mount point's mode.
-.It Cm nonc
-Do not use namecache to resolve names to files for the created mount.
-This saves memory, but currently might impair scalability for highly
-used mounts on large machines.
+Set the group ID of the root inode of the file system.
+The default is the mount point's GID.
.It Cm inodes
-Specifies the maximum number of nodes available to the file system.
+Set the maximum number of nodes available to the file system.
If not specified, the file system chooses a reasonable maximum based on
the file system size, which can be limited with the
.Cm size
option.
+.It Cm maxfilesize
+Set the maximum file size in bytes.
+The default is the maximum possible value.
+.It Cm mode
+Set the mode (in octal notation) of the root inode of the file system.
+The default is the mount point's mode.
+.It Cm nomtime
+Disable the tracking of mtime updates caused by writes to the
+shared mapped areas backed by
+.Nm
+files.
+This option removes periodic scans,
+which downgrade read-write-mapped pages to read-only to note the writes.
+.It Cm nonc
+Do not use namecache to resolve names to files for the created mount.
+This saves memory, but currently might impair scalability for highly
+used mounts on large machines.
+.It Cm nosymfollow
+Do not follow
+.Xr symlink 7 Ap s
+on the mounted file system.
+.It Cm pgread
+Enable pgcache read for the mount.
.It Cm size
-Specifies the total file system size in bytes, unless suffixed
+Set the total file system size in bytes, unless suffixed
with one of k, m, g, t, or p, which denote byte, kilobyte,
megabyte, gigabyte, terabyte and petabyte respectively.
If zero (the default) or a value larger than SIZE_MAX - PAGE_SIZE
is given, the available amount of memory (including
main memory and swap space) will be used.
-.It Cm maxfilesize
-Specifies the maximum file size in bytes.
-Defaults to the maximum possible value.
+.It Cm uid
+Set the user ID of the root inode of the file system.
+The default is the mount point's UID.
+.It Cm union
+Refer to
+.Xr mount 8 .
+.El
+.Sh SYSCTL VARIABLES
+The following
+.Xr sysctl 8
+variables are available:
+.Bl -tag -width indent
+.It Va vfs.tmpfs.memory_percent
+The percentage of memory plus swap space available at kernel file system
+initialization that can be used by a file system with a size of 0.
+When this amount of space in use is reached, new files cannot be created
+and files cannot be extended.
+The default is 95%.
+Changing this value also changes
+.Va vfs.tmpfs.memory_reserved .
+.It Va vfs.tmpfs.memory_reserved
+The currently-reserved amount of memory plus swap space
+based on the memory percentage.
+The minimum is compiled into the system, and defaults to 4 MB.
.El
.Sh EXAMPLES
-To mount a
+Mount a
.Nm
memory file system:
.Pp
.Dl "mount -t tmpfs tmpfs /tmp"
+.Pp
+Configure a
+.Nm
+mount via
+.Xr fstab 5 :
+.Bd -literal -offset indent
+tmpfs /tmp tmpfs rw 0 0
+.Ed
.Sh SEE ALSO
.Xr procstat 1 ,
.Xr mmap 2 ,