1 .\" Copyright (c) 2016 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH tmpfs 5 (date) "Linux man-pages (unreleased)"
7 tmpfs \- a virtual memory filesystem
11 facility allows the creation of filesystems whose contents reside
13 Since the files on such filesystems typically reside in RAM,
14 file access is extremely fast.
16 The filesystem is automatically created when mounting
17 a filesystem with the type
19 via a command such as the following:
23 $ sudo mount \-t tmpfs \-o size=10M tmpfs /mnt/mytmpfs
29 filesystem has the following properties:
31 The filesystem can employ swap space when physical memory pressure
34 The filesystem consumes only as much physical memory and swap space
35 as is required to store the current contents of the filesystem.
37 During a remount operation
38 .RI ( "mount\ \-o\ remount" ),
39 the filesystem size can be changed
40 (without losing the existing contents of the filesystem).
44 filesystem is unmounted, its contents are discarded (lost).
45 .\" See mm/shmem.c:shmem_parse_options for options it supports.
49 filesystem supports the following mount options:
51 .BR size "=\fIbytes\fP"
52 Specify an upper limit on the size of the filesystem.
53 The size is given in bytes, and rounded up to entire pages.
54 The limit is removed if the size is
62 suffix for Ki, Mi, Gi (binary kilo (kibi), binary mega (mebi), and binary giga
65 The size may also have a % suffix to limit this instance to a percentage of
68 The default, when neither
75 .BR nr_blocks "=\fIblocks\fP"
81 Blocks may be specified with
90 .BR nr_inodes "=\fIinodes\fP"
91 The maximum number of inodes for this instance.
92 The default is half of the number of your physical RAM pages, or (on a
93 machine with highmem) the number of lowmem RAM pages, whichever is smaller.
94 The limit is removed if the number is
97 Inodes may be specified with
106 .BR noswap "(since Linux 6.4)"
107 .\" commit 2c6efe9cf2d7841b75fe38ed1adbd41a90f51ba0
109 Remounts must respect the original settings.
110 By default swap is enabled.
112 .BR mode "=\fImode\fP"
113 Set initial permissions of the root directory.
115 .BR gid "=\fIgid\fP (since Linux 2.5.7)"
116 .\" Technically this is also in some version of Linux 2.4.
117 .\" commit 099445b489625b80b1d6687c9b6072dbeaca4096
118 Set the initial group ID of the root directory.
120 .BR uid "=\fIuid\fP (since Linux 2.5.7)"
121 .\" Technically this is also in some version of Linux 2.4.
122 .\" commit 099445b489625b80b1d6687c9b6072dbeaca4096
123 Set the initial user ID of the root directory.
125 .BR huge "=\fIhuge_option\fR (since Linux 4.7.0)"
126 .\" commit 5a6e75f8110c97e2a5488894d4e922187e6cb343
127 Set the huge table memory allocation policy for all files in this instance (if
128 .B CONFIG_TRANSPARENT_HUGEPAGE
133 value is one of the following:
137 Do not allocate huge pages.
141 Attempt to allocate huge pages every time a new page is needed.
144 Only allocate huge page if it will be fully within
153 Only allocate huge pages if requested with
159 For use in emergencies, to force the huge option off from all mounts.
162 Force the huge option on for all mounts; useful for testing.
165 .BR mpol "=\fImpol_option\fR (since Linux 2.6.15)"
166 .\" commit 7339ff8302fd70aabf5f1ae26e0c4905fa74a495
167 Set the NUMA memory allocation policy for all files in this instance (if
173 value is one of the following:
177 Use the process allocation policy (see
178 .BR set_mempolicy (2)).
180 .BR prefer ":\fInode\fP"
181 Preferably allocate memory from the given
184 .BR bind ":\fInodelist\fP"
185 Allocate memory only from nodes in
189 Allocate from each node in turn.
191 .BR interleave ":\fInodelist\fP"
192 Allocate from each node of
197 Preferably allocate memory from the local node.
202 is a comma-separated list of decimal numbers and ranges
203 that specify NUMA nodes.
204 A range is a pair of hyphen-separated decimal numbers,
205 the smallest and largest node numbers in the range.
207 .IR mpol=bind:0\-3,5,7,9\-15 .
211 facility was added in Linux 2.4, as a successor to the older
213 facility, which did not provide limit checking or
214 allow for the use of swap space.
216 In order for user-space tools and applications to create
218 filesystems, the kernel must be configured with the
224 filesystem supports extended attributes (see
228 extended attributes are not permitted.
230 An internal shared memory filesystem is used for
231 System V shared memory
233 and shared anonymous mappings
240 This filesystem is available regardless of whether
241 the kernel was configured with the
247 filesystem mounted at
249 is used for the implementation of POSIX shared memory
250 .RB ( shm_overview (7))
252 .RB ( sem_overview (7)).
254 The amount of memory consumed by all
256 filesystems is shown in the
267 facility was formerly called
272 .BR memfd_create (2),
274 .BR set_mempolicy (2),
278 The kernel source files
279 .I Documentation/filesystems/tmpfs.txt
281 .IR Documentation/admin\-guide/mm/transhuge.rst .