2 .\" Copyright (c) 2007 Xin LI
3 .\" Copyright (c) 2017 The FreeBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" Part of this documentation was written by
7 .\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
8 .\" from the FreeBSD Foundation.
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
19 .\" THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 .\" Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
32 .\" All rights reserved.
34 .\" Redistribution and use in source and binary forms, with or without
35 .\" modification, are permitted provided that the following conditions
37 .\" 1. Redistributions of source code must retain the above copyright
38 .\" notice, this list of conditions and the following disclaimer.
39 .\" 2. Redistributions in binary form must reproduce the above copyright
40 .\" notice, this list of conditions and the following disclaimer in the
41 .\" documentation and/or other materials provided with the distribution.
43 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
44 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
45 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
46 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
47 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
48 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
49 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
50 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
51 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
53 .\" POSSIBILITY OF SUCH DAMAGE.
62 .Nd "in-memory file system"
64 To compile this driver into the kernel,
65 place the following line in your
66 kernel configuration file:
67 .Bd -ragged -offset indent
71 Alternatively, to load the driver as a
72 module at boot time, place the following line in
74 .Bd -literal -offset indent
80 driver implements an in-memory, or
83 The filesystem stores both file metadata and data in main memory.
84 This allows very fast and low latency accesses to the data.
86 An umount or system reboot invalidates it.
87 These properties make the filesystem's mounts suitable for fast
91 If the system becomes low on memory and swap is configured (see
93 the system can transfer file data to swap space, freeing memory
95 Metadata, including the directory content, is never swapped out by the
96 current implementation.
97 Keep this in mind when planning the mount limits, especially when expecting
98 to place many small files on a tmpfs mount.
102 is used on a file from a tmpfs mount, the swap VM object managing the
103 file pages is used to implement mapping and avoid double-copying of
105 This quirk causes process inspection tools, like
107 to report anonymous memory mappings instead of file mappings.
109 The following options are available when
113 .Bl -tag -width "It Cm maxfilesize"
115 Specifies the group ID of the root inode of the file system.
116 Defaults to the mount point's GID.
118 Specifies the user ID of the root inode of the file system.
119 Defaults to the mount point's UID.
121 Specifies the mode (in octal notation) of the root inode of the file system.
122 Defaults to the mount point's mode.
124 Do not use namecache to resolve names to files for the created mount.
125 This saves memory, but currently might impair scalability for highly
126 used mounts on large machines.
128 Specifies the maximum number of nodes available to the file system.
129 If not specified, the file system chooses a reasonable maximum based on
130 the file system size, which can be limited with the
134 Specifies the total file system size in bytes, unless suffixed
135 with one of k, m, g, t, or p, which denote byte, kilobyte,
136 megabyte, gigabyte, terabyte and petabyte respectively.
137 If zero (the default) or a value larger than SIZE_MAX - PAGE_SIZE
138 is given, the available amount of memory (including
139 main memory and swap space) will be used.
141 Specifies the maximum file size in bytes.
142 Defaults to the maximum possible value.
149 .Dl "mount -t tmpfs tmpfs /tmp"
163 driver first appeared in
169 kernel implementation was written by
170 .An Julio M. Merino Vidal Aq Mt jmmv@NetBSD.org
171 as a Google Summer of Code project.
174 and others ported it from
179 This manual page was written by
180 .An Xin LI Aq Mt delphij@FreeBSD.org .