@@ -84,8 +84,6 @@ nr_inodes The maximum number of inodes for this instance. The default
8484 is half of the number of your physical RAM pages, or (on a
8585 machine with highmem) the number of lowmem RAM pages,
8686 whichever is the lower.
87- noswap Disables swap. Remounts must respect the original settings.
88- By default swap is enabled.
8987========= ============================================================
9088
9189These parameters accept a suffix k, m or g for kilo, mega and giga and
@@ -99,36 +97,31 @@ mount with such options, since it allows any user with write access to
9997use up all the memory on the machine; but enhances the scalability of
10098that instance in a system with many CPUs making intensive use of it.
10199
100+ tmpfs blocks may be swapped out, when there is a shortage of memory.
101+ tmpfs has a mount option to disable its use of swap:
102+
103+ ====== ===========================================================
104+ noswap Disables swap. Remounts must respect the original settings.
105+ By default swap is enabled.
106+ ====== ===========================================================
107+
102108tmpfs also supports Transparent Huge Pages which requires a kernel
103109configured with CONFIG_TRANSPARENT_HUGEPAGE and with huge supported for
104110your system (has_transparent_hugepage(), which is architecture specific).
105111The mount options for this are:
106112
107- ====== ============================================================
108- huge=0 never: disables huge pages for the mount
109- huge=1 always: enables huge pages for the mount
110- huge=2 within_size: only allocate huge pages if the page will be
111- fully within i_size, also respect fadvise()/madvise() hints.
112- huge=3 advise: only allocate huge pages if requested with
113- fadvise()/madvise()
114- ====== ============================================================
115-
116- There is a sysfs file which you can also use to control system wide THP
117- configuration for all tmpfs mounts, the file is:
118-
119- /sys/kernel/mm/transparent_hugepage/shmem_enabled
120-
121- This sysfs file is placed on top of THP sysfs directory and so is registered
122- by THP code. It is however only used to control all tmpfs mounts with one
123- single knob. Since it controls all tmpfs mounts it should only be used either
124- for emergency or testing purposes. The values you can set for shmem_enabled are:
125-
126- == ============================================================
127- -1 deny: disables huge on shm_mnt and all mounts, for
128- emergency use
129- -2 force: enables huge on shm_mnt and all mounts, w/o needing
130- option, for testing
131- == ============================================================
113+ ================ ==============================================================
114+ huge=never Do not allocate huge pages. This is the default.
115+ huge=always Attempt to allocate huge page every time a new page is needed.
116+ huge=within_size Only allocate huge page if it will be fully within i_size.
117+ Also respect madvise(2) hints.
118+ huge=advise Only allocate huge page if requested with madvise(2).
119+ ================ ==============================================================
120+
121+ See also Documentation/admin-guide/mm/transhuge.rst, which describes the
122+ sysfs file /sys/kernel/mm/transparent_hugepage/shmem_enabled: which can
123+ be used to deny huge pages on all tmpfs mounts in an emergency, or to
124+ force huge pages on all tmpfs mounts for testing.
132125
133126tmpfs has a mount option to set the NUMA memory allocation policy for
134127all files in that instance (if CONFIG_NUMA is enabled) - which can be
0 commit comments