xref: /linux/mm/Kconfig (revision 0710d0122abc93adcb9a70a78f1625c491f6ad91)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
259e0b520SChristoph Hellwig
359e0b520SChristoph Hellwigmenu "Memory Management options"
459e0b520SChristoph Hellwig
57b42f104SJohannes Weiner#
67b42f104SJohannes Weiner# For some reason microblaze and nios2 hard code SWAP=n.  Hopefully we can
77b42f104SJohannes Weiner# add proper SWAP support to them, in which case this can be remove.
87b42f104SJohannes Weiner#
97b42f104SJohannes Weinerconfig ARCH_NO_SWAP
107b42f104SJohannes Weiner	bool
117b42f104SJohannes Weiner
12b3fbd58fSJohannes Weinerconfig ZPOOL
13b3fbd58fSJohannes Weiner	bool
14b3fbd58fSJohannes Weiner
15519bcb79SJohannes Weinermenuconfig SWAP
167b42f104SJohannes Weiner	bool "Support for paging of anonymous memory (swap)"
177b42f104SJohannes Weiner	depends on MMU && BLOCK && !ARCH_NO_SWAP
187b42f104SJohannes Weiner	default y
197b42f104SJohannes Weiner	help
207b42f104SJohannes Weiner	  This option allows you to choose whether you want to have support
217b42f104SJohannes Weiner	  for so called swap devices or swap files in your kernel that are
227b42f104SJohannes Weiner	  used to provide more virtual memory than the actual RAM present
237b42f104SJohannes Weiner	  in your computer.  If unsure say Y.
247b42f104SJohannes Weiner
25519bcb79SJohannes Weinerconfig ZSWAP
26519bcb79SJohannes Weiner	bool "Compressed cache for swap pages (EXPERIMENTAL)"
27b3fbd58fSJohannes Weiner	depends on SWAP
28519bcb79SJohannes Weiner	select FRONTSWAP
29b3fbd58fSJohannes Weiner	select CRYPTO
30519bcb79SJohannes Weiner	select ZPOOL
31519bcb79SJohannes Weiner	help
32519bcb79SJohannes Weiner	  A lightweight compressed cache for swap pages.  It takes
33519bcb79SJohannes Weiner	  pages that are in the process of being swapped out and attempts to
34519bcb79SJohannes Weiner	  compress them into a dynamically allocated RAM-based memory pool.
35519bcb79SJohannes Weiner	  This can result in a significant I/O reduction on swap device and,
36519bcb79SJohannes Weiner	  in the case where decompressing from RAM is faster that swap device
37519bcb79SJohannes Weiner	  reads, can also improve workload performance.
38519bcb79SJohannes Weiner
39519bcb79SJohannes Weiner	  This is marked experimental because it is a new feature (as of
40519bcb79SJohannes Weiner	  v3.11) that interacts heavily with memory reclaim.  While these
41519bcb79SJohannes Weiner	  interactions don't cause any known issues on simple memory setups,
42519bcb79SJohannes Weiner	  they have not be fully explored on the large set of potential
43519bcb79SJohannes Weiner	  configurations and workloads that exist.
44519bcb79SJohannes Weiner
45b3fbd58fSJohannes Weinerconfig ZSWAP_DEFAULT_ON
46b3fbd58fSJohannes Weiner	bool "Enable the compressed cache for swap pages by default"
47b3fbd58fSJohannes Weiner	depends on ZSWAP
48b3fbd58fSJohannes Weiner	help
49b3fbd58fSJohannes Weiner	  If selected, the compressed cache for swap pages will be enabled
50b3fbd58fSJohannes Weiner	  at boot, otherwise it will be disabled.
51b3fbd58fSJohannes Weiner
52b3fbd58fSJohannes Weiner	  The selection made here can be overridden by using the kernel
53b3fbd58fSJohannes Weiner	  command line 'zswap.enabled=' option.
54b3fbd58fSJohannes Weiner
55519bcb79SJohannes Weinerchoice
56b3fbd58fSJohannes Weiner	prompt "Default compressor"
57519bcb79SJohannes Weiner	depends on ZSWAP
58519bcb79SJohannes Weiner	default ZSWAP_COMPRESSOR_DEFAULT_LZO
59519bcb79SJohannes Weiner	help
60519bcb79SJohannes Weiner	  Selects the default compression algorithm for the compressed cache
61519bcb79SJohannes Weiner	  for swap pages.
62519bcb79SJohannes Weiner
63519bcb79SJohannes Weiner	  For an overview what kind of performance can be expected from
64519bcb79SJohannes Weiner	  a particular compression algorithm please refer to the benchmarks
65519bcb79SJohannes Weiner	  available at the following LWN page:
66519bcb79SJohannes Weiner	  https://lwn.net/Articles/751795/
67519bcb79SJohannes Weiner
68519bcb79SJohannes Weiner	  If in doubt, select 'LZO'.
69519bcb79SJohannes Weiner
70519bcb79SJohannes Weiner	  The selection made here can be overridden by using the kernel
71519bcb79SJohannes Weiner	  command line 'zswap.compressor=' option.
72519bcb79SJohannes Weiner
73519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_DEFLATE
74519bcb79SJohannes Weiner	bool "Deflate"
75519bcb79SJohannes Weiner	select CRYPTO_DEFLATE
76519bcb79SJohannes Weiner	help
77519bcb79SJohannes Weiner	  Use the Deflate algorithm as the default compression algorithm.
78519bcb79SJohannes Weiner
79519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_LZO
80519bcb79SJohannes Weiner	bool "LZO"
81519bcb79SJohannes Weiner	select CRYPTO_LZO
82519bcb79SJohannes Weiner	help
83519bcb79SJohannes Weiner	  Use the LZO algorithm as the default compression algorithm.
84519bcb79SJohannes Weiner
85519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_842
86519bcb79SJohannes Weiner	bool "842"
87519bcb79SJohannes Weiner	select CRYPTO_842
88519bcb79SJohannes Weiner	help
89519bcb79SJohannes Weiner	  Use the 842 algorithm as the default compression algorithm.
90519bcb79SJohannes Weiner
91519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_LZ4
92519bcb79SJohannes Weiner	bool "LZ4"
93519bcb79SJohannes Weiner	select CRYPTO_LZ4
94519bcb79SJohannes Weiner	help
95519bcb79SJohannes Weiner	  Use the LZ4 algorithm as the default compression algorithm.
96519bcb79SJohannes Weiner
97519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_LZ4HC
98519bcb79SJohannes Weiner	bool "LZ4HC"
99519bcb79SJohannes Weiner	select CRYPTO_LZ4HC
100519bcb79SJohannes Weiner	help
101519bcb79SJohannes Weiner	  Use the LZ4HC algorithm as the default compression algorithm.
102519bcb79SJohannes Weiner
103519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_ZSTD
104519bcb79SJohannes Weiner	bool "zstd"
105519bcb79SJohannes Weiner	select CRYPTO_ZSTD
106519bcb79SJohannes Weiner	help
107519bcb79SJohannes Weiner	  Use the zstd algorithm as the default compression algorithm.
108519bcb79SJohannes Weinerendchoice
109519bcb79SJohannes Weiner
110519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT
111519bcb79SJohannes Weiner       string
112519bcb79SJohannes Weiner       depends on ZSWAP
113519bcb79SJohannes Weiner       default "deflate" if ZSWAP_COMPRESSOR_DEFAULT_DEFLATE
114519bcb79SJohannes Weiner       default "lzo" if ZSWAP_COMPRESSOR_DEFAULT_LZO
115519bcb79SJohannes Weiner       default "842" if ZSWAP_COMPRESSOR_DEFAULT_842
116519bcb79SJohannes Weiner       default "lz4" if ZSWAP_COMPRESSOR_DEFAULT_LZ4
117519bcb79SJohannes Weiner       default "lz4hc" if ZSWAP_COMPRESSOR_DEFAULT_LZ4HC
118519bcb79SJohannes Weiner       default "zstd" if ZSWAP_COMPRESSOR_DEFAULT_ZSTD
119519bcb79SJohannes Weiner       default ""
120519bcb79SJohannes Weiner
121519bcb79SJohannes Weinerchoice
122b3fbd58fSJohannes Weiner	prompt "Default allocator"
123519bcb79SJohannes Weiner	depends on ZSWAP
124519bcb79SJohannes Weiner	default ZSWAP_ZPOOL_DEFAULT_ZBUD
125519bcb79SJohannes Weiner	help
126519bcb79SJohannes Weiner	  Selects the default allocator for the compressed cache for
127519bcb79SJohannes Weiner	  swap pages.
128519bcb79SJohannes Weiner	  The default is 'zbud' for compatibility, however please do
129519bcb79SJohannes Weiner	  read the description of each of the allocators below before
130519bcb79SJohannes Weiner	  making a right choice.
131519bcb79SJohannes Weiner
132519bcb79SJohannes Weiner	  The selection made here can be overridden by using the kernel
133519bcb79SJohannes Weiner	  command line 'zswap.zpool=' option.
134519bcb79SJohannes Weiner
135519bcb79SJohannes Weinerconfig ZSWAP_ZPOOL_DEFAULT_ZBUD
136519bcb79SJohannes Weiner	bool "zbud"
137519bcb79SJohannes Weiner	select ZBUD
138519bcb79SJohannes Weiner	help
139519bcb79SJohannes Weiner	  Use the zbud allocator as the default allocator.
140519bcb79SJohannes Weiner
141519bcb79SJohannes Weinerconfig ZSWAP_ZPOOL_DEFAULT_Z3FOLD
142519bcb79SJohannes Weiner	bool "z3fold"
143519bcb79SJohannes Weiner	select Z3FOLD
144519bcb79SJohannes Weiner	help
145519bcb79SJohannes Weiner	  Use the z3fold allocator as the default allocator.
146519bcb79SJohannes Weiner
147519bcb79SJohannes Weinerconfig ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
148519bcb79SJohannes Weiner	bool "zsmalloc"
149519bcb79SJohannes Weiner	select ZSMALLOC
150519bcb79SJohannes Weiner	help
151519bcb79SJohannes Weiner	  Use the zsmalloc allocator as the default allocator.
152519bcb79SJohannes Weinerendchoice
153519bcb79SJohannes Weiner
154519bcb79SJohannes Weinerconfig ZSWAP_ZPOOL_DEFAULT
155519bcb79SJohannes Weiner       string
156519bcb79SJohannes Weiner       depends on ZSWAP
157519bcb79SJohannes Weiner       default "zbud" if ZSWAP_ZPOOL_DEFAULT_ZBUD
158519bcb79SJohannes Weiner       default "z3fold" if ZSWAP_ZPOOL_DEFAULT_Z3FOLD
159519bcb79SJohannes Weiner       default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
160519bcb79SJohannes Weiner       default ""
161519bcb79SJohannes Weiner
162519bcb79SJohannes Weinerconfig ZBUD
163b3fbd58fSJohannes Weiner	tristate "2:1 compression allocator (zbud)"
164b3fbd58fSJohannes Weiner	depends on ZSWAP
165519bcb79SJohannes Weiner	help
166519bcb79SJohannes Weiner	  A special purpose allocator for storing compressed pages.
167519bcb79SJohannes Weiner	  It is designed to store up to two compressed pages per physical
168519bcb79SJohannes Weiner	  page.  While this design limits storage density, it has simple and
169519bcb79SJohannes Weiner	  deterministic reclaim properties that make it preferable to a higher
170519bcb79SJohannes Weiner	  density approach when reclaim will be used.
171519bcb79SJohannes Weiner
172519bcb79SJohannes Weinerconfig Z3FOLD
173b3fbd58fSJohannes Weiner	tristate "3:1 compression allocator (z3fold)"
174b3fbd58fSJohannes Weiner	depends on ZSWAP
175519bcb79SJohannes Weiner	help
176519bcb79SJohannes Weiner	  A special purpose allocator for storing compressed pages.
177519bcb79SJohannes Weiner	  It is designed to store up to three compressed pages per physical
178519bcb79SJohannes Weiner	  page. It is a ZBUD derivative so the simplicity and determinism are
179519bcb79SJohannes Weiner	  still there.
180519bcb79SJohannes Weiner
181519bcb79SJohannes Weinerconfig ZSMALLOC
182b3fbd58fSJohannes Weiner	tristate
183b3fbd58fSJohannes Weiner	prompt "N:1 compression allocator (zsmalloc)" if ZSWAP
184519bcb79SJohannes Weiner	depends on MMU
185519bcb79SJohannes Weiner	help
186519bcb79SJohannes Weiner	  zsmalloc is a slab-based memory allocator designed to store
187b3fbd58fSJohannes Weiner	  pages of various compression levels efficiently. It achieves
188b3fbd58fSJohannes Weiner	  the highest storage density with the least amount of fragmentation.
189519bcb79SJohannes Weiner
190519bcb79SJohannes Weinerconfig ZSMALLOC_STAT
191519bcb79SJohannes Weiner	bool "Export zsmalloc statistics"
192519bcb79SJohannes Weiner	depends on ZSMALLOC
193519bcb79SJohannes Weiner	select DEBUG_FS
194519bcb79SJohannes Weiner	help
195519bcb79SJohannes Weiner	  This option enables code in the zsmalloc to collect various
196519bcb79SJohannes Weiner	  statistics about what's happening in zsmalloc and exports that
197519bcb79SJohannes Weiner	  information to userspace via debugfs.
198519bcb79SJohannes Weiner	  If unsure, say N.
199519bcb79SJohannes Weiner
200519bcb79SJohannes Weinermenu "SLAB allocator options"
201519bcb79SJohannes Weiner
2027b42f104SJohannes Weinerchoice
2037b42f104SJohannes Weiner	prompt "Choose SLAB allocator"
2047b42f104SJohannes Weiner	default SLUB
2057b42f104SJohannes Weiner	help
2067b42f104SJohannes Weiner	   This option allows to select a slab allocator.
2077b42f104SJohannes Weiner
2087b42f104SJohannes Weinerconfig SLAB
2097b42f104SJohannes Weiner	bool "SLAB"
2107b42f104SJohannes Weiner	depends on !PREEMPT_RT
2117b42f104SJohannes Weiner	select HAVE_HARDENED_USERCOPY_ALLOCATOR
2127b42f104SJohannes Weiner	help
2137b42f104SJohannes Weiner	  The regular slab allocator that is established and known to work
2147b42f104SJohannes Weiner	  well in all environments. It organizes cache hot objects in
2157b42f104SJohannes Weiner	  per cpu and per node queues.
2167b42f104SJohannes Weiner
2177b42f104SJohannes Weinerconfig SLUB
2187b42f104SJohannes Weiner	bool "SLUB (Unqueued Allocator)"
2197b42f104SJohannes Weiner	select HAVE_HARDENED_USERCOPY_ALLOCATOR
2207b42f104SJohannes Weiner	help
2217b42f104SJohannes Weiner	   SLUB is a slab allocator that minimizes cache line usage
2227b42f104SJohannes Weiner	   instead of managing queues of cached objects (SLAB approach).
2237b42f104SJohannes Weiner	   Per cpu caching is realized using slabs of objects instead
2247b42f104SJohannes Weiner	   of queues of objects. SLUB can use memory efficiently
2257b42f104SJohannes Weiner	   and has enhanced diagnostics. SLUB is the default choice for
2267b42f104SJohannes Weiner	   a slab allocator.
2277b42f104SJohannes Weiner
2287b42f104SJohannes Weinerconfig SLOB
2297b42f104SJohannes Weiner	depends on EXPERT
2307b42f104SJohannes Weiner	bool "SLOB (Simple Allocator)"
2317b42f104SJohannes Weiner	depends on !PREEMPT_RT
2327b42f104SJohannes Weiner	help
2337b42f104SJohannes Weiner	   SLOB replaces the stock allocator with a drastically simpler
2347b42f104SJohannes Weiner	   allocator. SLOB is generally more space efficient but
2357b42f104SJohannes Weiner	   does not perform as well on large systems.
2367b42f104SJohannes Weiner
2377b42f104SJohannes Weinerendchoice
2387b42f104SJohannes Weiner
2397b42f104SJohannes Weinerconfig SLAB_MERGE_DEFAULT
2407b42f104SJohannes Weiner	bool "Allow slab caches to be merged"
2417b42f104SJohannes Weiner	default y
2427b42f104SJohannes Weiner	depends on SLAB || SLUB
2437b42f104SJohannes Weiner	help
2447b42f104SJohannes Weiner	  For reduced kernel memory fragmentation, slab caches can be
2457b42f104SJohannes Weiner	  merged when they share the same size and other characteristics.
2467b42f104SJohannes Weiner	  This carries a risk of kernel heap overflows being able to
2477b42f104SJohannes Weiner	  overwrite objects from merged caches (and more easily control
2487b42f104SJohannes Weiner	  cache layout), which makes such heap attacks easier to exploit
2497b42f104SJohannes Weiner	  by attackers. By keeping caches unmerged, these kinds of exploits
2507b42f104SJohannes Weiner	  can usually only damage objects in the same cache. To disable
2517b42f104SJohannes Weiner	  merging at runtime, "slab_nomerge" can be passed on the kernel
2527b42f104SJohannes Weiner	  command line.
2537b42f104SJohannes Weiner
2547b42f104SJohannes Weinerconfig SLAB_FREELIST_RANDOM
2557b42f104SJohannes Weiner	bool "Randomize slab freelist"
2567b42f104SJohannes Weiner	depends on SLAB || SLUB
2577b42f104SJohannes Weiner	help
2587b42f104SJohannes Weiner	  Randomizes the freelist order used on creating new pages. This
2597b42f104SJohannes Weiner	  security feature reduces the predictability of the kernel slab
2607b42f104SJohannes Weiner	  allocator against heap overflows.
2617b42f104SJohannes Weiner
2627b42f104SJohannes Weinerconfig SLAB_FREELIST_HARDENED
2637b42f104SJohannes Weiner	bool "Harden slab freelist metadata"
2647b42f104SJohannes Weiner	depends on SLAB || SLUB
2657b42f104SJohannes Weiner	help
2667b42f104SJohannes Weiner	  Many kernel heap attacks try to target slab cache metadata and
2677b42f104SJohannes Weiner	  other infrastructure. This options makes minor performance
2687b42f104SJohannes Weiner	  sacrifices to harden the kernel slab allocator against common
2697b42f104SJohannes Weiner	  freelist exploit methods. Some slab implementations have more
2707b42f104SJohannes Weiner	  sanity-checking than others. This option is most effective with
2717b42f104SJohannes Weiner	  CONFIG_SLUB.
2727b42f104SJohannes Weiner
273*0710d012SVlastimil Babkaconfig SLUB_STATS
274*0710d012SVlastimil Babka	default n
275*0710d012SVlastimil Babka	bool "Enable SLUB performance statistics"
276*0710d012SVlastimil Babka	depends on SLUB && SYSFS
277*0710d012SVlastimil Babka	help
278*0710d012SVlastimil Babka	  SLUB statistics are useful to debug SLUBs allocation behavior in
279*0710d012SVlastimil Babka	  order find ways to optimize the allocator. This should never be
280*0710d012SVlastimil Babka	  enabled for production use since keeping statistics slows down
281*0710d012SVlastimil Babka	  the allocator by a few percentage points. The slabinfo command
282*0710d012SVlastimil Babka	  supports the determination of the most active slabs to figure
283*0710d012SVlastimil Babka	  out which slabs are relevant to a particular load.
284*0710d012SVlastimil Babka	  Try running: slabinfo -DA
285*0710d012SVlastimil Babka
286519bcb79SJohannes Weinerconfig SLUB_CPU_PARTIAL
287519bcb79SJohannes Weiner	default y
288519bcb79SJohannes Weiner	depends on SLUB && SMP
289519bcb79SJohannes Weiner	bool "SLUB per cpu partial cache"
290519bcb79SJohannes Weiner	help
291519bcb79SJohannes Weiner	  Per cpu partial caches accelerate objects allocation and freeing
292519bcb79SJohannes Weiner	  that is local to a processor at the price of more indeterminism
293519bcb79SJohannes Weiner	  in the latency of the free. On overflow these caches will be cleared
294519bcb79SJohannes Weiner	  which requires the taking of locks that may cause latency spikes.
295519bcb79SJohannes Weiner	  Typically one would choose no for a realtime system.
296519bcb79SJohannes Weiner
297519bcb79SJohannes Weinerendmenu # SLAB allocator options
298519bcb79SJohannes Weiner
2997b42f104SJohannes Weinerconfig SHUFFLE_PAGE_ALLOCATOR
3007b42f104SJohannes Weiner	bool "Page allocator randomization"
3017b42f104SJohannes Weiner	default SLAB_FREELIST_RANDOM && ACPI_NUMA
3027b42f104SJohannes Weiner	help
3037b42f104SJohannes Weiner	  Randomization of the page allocator improves the average
3047b42f104SJohannes Weiner	  utilization of a direct-mapped memory-side-cache. See section
3057b42f104SJohannes Weiner	  5.2.27 Heterogeneous Memory Attribute Table (HMAT) in the ACPI
3067b42f104SJohannes Weiner	  6.2a specification for an example of how a platform advertises
3077b42f104SJohannes Weiner	  the presence of a memory-side-cache. There are also incidental
3087b42f104SJohannes Weiner	  security benefits as it reduces the predictability of page
3097b42f104SJohannes Weiner	  allocations to compliment SLAB_FREELIST_RANDOM, but the
3107b42f104SJohannes Weiner	  default granularity of shuffling on the "MAX_ORDER - 1" i.e,
3117b42f104SJohannes Weiner	  10th order of pages is selected based on cache utilization
3127b42f104SJohannes Weiner	  benefits on x86.
3137b42f104SJohannes Weiner
3147b42f104SJohannes Weiner	  While the randomization improves cache utilization it may
3157b42f104SJohannes Weiner	  negatively impact workloads on platforms without a cache. For
3167b42f104SJohannes Weiner	  this reason, by default, the randomization is enabled only
3177b42f104SJohannes Weiner	  after runtime detection of a direct-mapped memory-side-cache.
3187b42f104SJohannes Weiner	  Otherwise, the randomization may be force enabled with the
3197b42f104SJohannes Weiner	  'page_alloc.shuffle' kernel command line parameter.
3207b42f104SJohannes Weiner
3217b42f104SJohannes Weiner	  Say Y if unsure.
3227b42f104SJohannes Weiner
323*0710d012SVlastimil Babkaconfig COMPAT_BRK
324*0710d012SVlastimil Babka	bool "Disable heap randomization"
325*0710d012SVlastimil Babka	default y
326*0710d012SVlastimil Babka	help
327*0710d012SVlastimil Babka	  Randomizing heap placement makes heap exploits harder, but it
328*0710d012SVlastimil Babka	  also breaks ancient binaries (including anything libc5 based).
329*0710d012SVlastimil Babka	  This option changes the bootup default to heap randomization
330*0710d012SVlastimil Babka	  disabled, and can be overridden at runtime by setting
331*0710d012SVlastimil Babka	  /proc/sys/kernel/randomize_va_space to 2.
332*0710d012SVlastimil Babka
333*0710d012SVlastimil Babka	  On non-ancient distros (post-2000 ones) N is usually a safe choice.
334*0710d012SVlastimil Babka
335*0710d012SVlastimil Babkaconfig MMAP_ALLOW_UNINITIALIZED
336*0710d012SVlastimil Babka	bool "Allow mmapped anonymous memory to be uninitialized"
337*0710d012SVlastimil Babka	depends on EXPERT && !MMU
338*0710d012SVlastimil Babka	default n
339*0710d012SVlastimil Babka	help
340*0710d012SVlastimil Babka	  Normally, and according to the Linux spec, anonymous memory obtained
341*0710d012SVlastimil Babka	  from mmap() has its contents cleared before it is passed to
342*0710d012SVlastimil Babka	  userspace.  Enabling this config option allows you to request that
343*0710d012SVlastimil Babka	  mmap() skip that if it is given an MAP_UNINITIALIZED flag, thus
344*0710d012SVlastimil Babka	  providing a huge performance boost.  If this option is not enabled,
345*0710d012SVlastimil Babka	  then the flag will be ignored.
346*0710d012SVlastimil Babka
347*0710d012SVlastimil Babka	  This is taken advantage of by uClibc's malloc(), and also by
348*0710d012SVlastimil Babka	  ELF-FDPIC binfmt's brk and stack allocator.
349*0710d012SVlastimil Babka
350*0710d012SVlastimil Babka	  Because of the obvious security issues, this option should only be
351*0710d012SVlastimil Babka	  enabled on embedded devices where you control what is run in
352*0710d012SVlastimil Babka	  userspace.  Since that isn't generally a problem on no-MMU systems,
353*0710d012SVlastimil Babka	  it is normally safe to say Y here.
354*0710d012SVlastimil Babka
355*0710d012SVlastimil Babka	  See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
356*0710d012SVlastimil Babka
357e1785e85SDave Hansenconfig SELECT_MEMORY_MODEL
358e1785e85SDave Hansen	def_bool y
359a8826eebSKees Cook	depends on ARCH_SELECT_MEMORY_MODEL
360e1785e85SDave Hansen
3613a9da765SDave Hansenchoice
3623a9da765SDave Hansen	prompt "Memory model"
363e1785e85SDave Hansen	depends on SELECT_MEMORY_MODEL
364d41dee36SAndy Whitcroft	default SPARSEMEM_MANUAL if ARCH_SPARSEMEM_DEFAULT
365e1785e85SDave Hansen	default FLATMEM_MANUAL
366d66d109dSMike Rapoport	help
367d66d109dSMike Rapoport	  This option allows you to change some of the ways that
368d66d109dSMike Rapoport	  Linux manages its memory internally. Most users will
369d66d109dSMike Rapoport	  only have one option here selected by the architecture
370d66d109dSMike Rapoport	  configuration. This is normal.
3713a9da765SDave Hansen
372e1785e85SDave Hansenconfig FLATMEM_MANUAL
3733a9da765SDave Hansen	bool "Flat Memory"
374bb1c50d3SMike Rapoport	depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE
3753a9da765SDave Hansen	help
376d66d109dSMike Rapoport	  This option is best suited for non-NUMA systems with
377d66d109dSMike Rapoport	  flat address space. The FLATMEM is the most efficient
378d66d109dSMike Rapoport	  system in terms of performance and resource consumption
379d66d109dSMike Rapoport	  and it is the best option for smaller systems.
3803a9da765SDave Hansen
381d66d109dSMike Rapoport	  For systems that have holes in their physical address
382d66d109dSMike Rapoport	  spaces and for features like NUMA and memory hotplug,
383dd33d29aSRandy Dunlap	  choose "Sparse Memory".
384d41dee36SAndy Whitcroft
385d41dee36SAndy Whitcroft	  If unsure, choose this option (Flat Memory) over any other.
3863a9da765SDave Hansen
387d41dee36SAndy Whitcroftconfig SPARSEMEM_MANUAL
388d41dee36SAndy Whitcroft	bool "Sparse Memory"
389d41dee36SAndy Whitcroft	depends on ARCH_SPARSEMEM_ENABLE
390d41dee36SAndy Whitcroft	help
391d41dee36SAndy Whitcroft	  This will be the only option for some systems, including
392d66d109dSMike Rapoport	  memory hot-plug systems.  This is normal.
393d41dee36SAndy Whitcroft
394d66d109dSMike Rapoport	  This option provides efficient support for systems with
395d66d109dSMike Rapoport	  holes is their physical address space and allows memory
396d66d109dSMike Rapoport	  hot-plug and hot-remove.
397d41dee36SAndy Whitcroft
398d66d109dSMike Rapoport	  If unsure, choose "Flat Memory" over this option.
399d41dee36SAndy Whitcroft
4003a9da765SDave Hansenendchoice
4013a9da765SDave Hansen
402d41dee36SAndy Whitcroftconfig SPARSEMEM
403d41dee36SAndy Whitcroft	def_bool y
4041a83e175SRussell King	depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL
405d41dee36SAndy Whitcroft
406e1785e85SDave Hansenconfig FLATMEM
407e1785e85SDave Hansen	def_bool y
408bb1c50d3SMike Rapoport	depends on !SPARSEMEM || FLATMEM_MANUAL
409d41dee36SAndy Whitcroft
41093b7504eSDave Hansen#
4113e347261SBob Picco# SPARSEMEM_EXTREME (which is the default) does some bootmem
412c89ab04fSMike Rapoport# allocations when sparse_init() is called.  If this cannot
4133e347261SBob Picco# be done on your architecture, select this option.  However,
4143e347261SBob Picco# statically allocating the mem_section[] array can potentially
4153e347261SBob Picco# consume vast quantities of .bss, so be careful.
4163e347261SBob Picco#
4173e347261SBob Picco# This option will also potentially produce smaller runtime code
4183e347261SBob Picco# with gcc 3.4 and later.
4193e347261SBob Picco#
4203e347261SBob Piccoconfig SPARSEMEM_STATIC
4219ba16087SJan Beulich	bool
4223e347261SBob Picco
4233e347261SBob Picco#
42444c09201SMatt LaPlante# Architecture platforms which require a two level mem_section in SPARSEMEM
425802f192eSBob Picco# must select this option. This is usually for architecture platforms with
426802f192eSBob Picco# an extremely sparse physical address space.
427802f192eSBob Picco#
4283e347261SBob Piccoconfig SPARSEMEM_EXTREME
4293e347261SBob Picco	def_bool y
4303e347261SBob Picco	depends on SPARSEMEM && !SPARSEMEM_STATIC
4314c21e2f2SHugh Dickins
43229c71111SAndy Whitcroftconfig SPARSEMEM_VMEMMAP_ENABLE
4339ba16087SJan Beulich	bool
43429c71111SAndy Whitcroft
43529c71111SAndy Whitcroftconfig SPARSEMEM_VMEMMAP
436a5ee6daaSGeoff Levand	bool "Sparse Memory virtual memmap"
437a5ee6daaSGeoff Levand	depends on SPARSEMEM && SPARSEMEM_VMEMMAP_ENABLE
438a5ee6daaSGeoff Levand	default y
439a5ee6daaSGeoff Levand	help
440a5ee6daaSGeoff Levand	  SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise
441a5ee6daaSGeoff Levand	  pfn_to_page and page_to_pfn operations.  This is the most
442a5ee6daaSGeoff Levand	  efficient option when sufficient kernel resources are available.
44329c71111SAndy Whitcroft
44470210ed9SPhilipp Hachtmannconfig HAVE_MEMBLOCK_PHYS_MAP
4456341e62bSChristoph Jaeger	bool
44670210ed9SPhilipp Hachtmann
44767a929e0SChristoph Hellwigconfig HAVE_FAST_GUP
448050a9adcSChristoph Hellwig	depends on MMU
4496341e62bSChristoph Jaeger	bool
4502667f50eSSteve Capper
45152219aeaSDavid Hildenbrand# Don't discard allocated memory used to track "memory" and "reserved" memblocks
45252219aeaSDavid Hildenbrand# after early boot, so it can still be used to test for validity of memory.
45352219aeaSDavid Hildenbrand# Also, memblocks are updated with memory hot(un)plug.
454350e88baSMike Rapoportconfig ARCH_KEEP_MEMBLOCK
4556341e62bSChristoph Jaeger	bool
456c378ddd5STejun Heo
4571e5d8e1eSDan Williams# Keep arch NUMA mapping infrastructure post-init.
4581e5d8e1eSDan Williamsconfig NUMA_KEEP_MEMINFO
4591e5d8e1eSDan Williams	bool
4601e5d8e1eSDan Williams
461ee6f509cSMinchan Kimconfig MEMORY_ISOLATION
4626341e62bSChristoph Jaeger	bool
463ee6f509cSMinchan Kim
464a9e7b8d4SDavid Hildenbrand# IORESOURCE_SYSTEM_RAM regions in the kernel resource tree that are marked
465a9e7b8d4SDavid Hildenbrand# IORESOURCE_EXCLUSIVE cannot be mapped to user space, for example, via
466a9e7b8d4SDavid Hildenbrand# /dev/mem.
467a9e7b8d4SDavid Hildenbrandconfig EXCLUSIVE_SYSTEM_RAM
468a9e7b8d4SDavid Hildenbrand	def_bool y
469a9e7b8d4SDavid Hildenbrand	depends on !DEVMEM || STRICT_DEVMEM
470a9e7b8d4SDavid Hildenbrand
47146723bfaSYasuaki Ishimatsu#
47246723bfaSYasuaki Ishimatsu# Only be set on architectures that have completely implemented memory hotplug
47346723bfaSYasuaki Ishimatsu# feature. If you are not sure, don't touch it.
47446723bfaSYasuaki Ishimatsu#
47546723bfaSYasuaki Ishimatsuconfig HAVE_BOOTMEM_INFO_NODE
47646723bfaSYasuaki Ishimatsu	def_bool n
47746723bfaSYasuaki Ishimatsu
47891024b3cSAnshuman Khandualconfig ARCH_ENABLE_MEMORY_HOTPLUG
47991024b3cSAnshuman Khandual	bool
48091024b3cSAnshuman Khandual
481519bcb79SJohannes Weinerconfig ARCH_ENABLE_MEMORY_HOTREMOVE
482519bcb79SJohannes Weiner	bool
483519bcb79SJohannes Weiner
4843947be19SDave Hansen# eventually, we can have this option just 'select SPARSEMEM'
485519bcb79SJohannes Weinermenuconfig MEMORY_HOTPLUG
486519bcb79SJohannes Weiner	bool "Memory hotplug"
487b30c5927SDavid Hildenbrand	select MEMORY_ISOLATION
48871b6f2ddSDavid Hildenbrand	depends on SPARSEMEM
48940b31360SStephen Rothwell	depends on ARCH_ENABLE_MEMORY_HOTPLUG
4907ec58a2bSDavid Hildenbrand	depends on 64BIT
4911e5d8e1eSDan Williams	select NUMA_KEEP_MEMINFO if NUMA
4923947be19SDave Hansen
493519bcb79SJohannes Weinerif MEMORY_HOTPLUG
494519bcb79SJohannes Weiner
4958604d9e5SVitaly Kuznetsovconfig MEMORY_HOTPLUG_DEFAULT_ONLINE
4968604d9e5SVitaly Kuznetsov	bool "Online the newly added memory blocks by default"
4978604d9e5SVitaly Kuznetsov	depends on MEMORY_HOTPLUG
4988604d9e5SVitaly Kuznetsov	help
4998604d9e5SVitaly Kuznetsov	  This option sets the default policy setting for memory hotplug
5008604d9e5SVitaly Kuznetsov	  onlining policy (/sys/devices/system/memory/auto_online_blocks) which
5018604d9e5SVitaly Kuznetsov	  determines what happens to newly added memory regions. Policy setting
5028604d9e5SVitaly Kuznetsov	  can always be changed at runtime.
503cb1aaebeSMauro Carvalho Chehab	  See Documentation/admin-guide/mm/memory-hotplug.rst for more information.
5048604d9e5SVitaly Kuznetsov
5058604d9e5SVitaly Kuznetsov	  Say Y here if you want all hot-plugged memory blocks to appear in
5068604d9e5SVitaly Kuznetsov	  'online' state by default.
5078604d9e5SVitaly Kuznetsov	  Say N here if you want the default policy to keep all hot-plugged
5088604d9e5SVitaly Kuznetsov	  memory blocks in 'offline' state.
5098604d9e5SVitaly Kuznetsov
5100c0e6195SKAMEZAWA Hiroyukiconfig MEMORY_HOTREMOVE
5110c0e6195SKAMEZAWA Hiroyuki	bool "Allow for memory hot remove"
512f7e3334aSNathan Fontenot	select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
5130c0e6195SKAMEZAWA Hiroyuki	depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
5140c0e6195SKAMEZAWA Hiroyuki	depends on MIGRATION
5150c0e6195SKAMEZAWA Hiroyuki
516a08a2ae3SOscar Salvadorconfig MHP_MEMMAP_ON_MEMORY
517a08a2ae3SOscar Salvador	def_bool y
518a08a2ae3SOscar Salvador	depends on MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP
519a08a2ae3SOscar Salvador	depends on ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
520a08a2ae3SOscar Salvador
521519bcb79SJohannes Weinerendif # MEMORY_HOTPLUG
522519bcb79SJohannes Weiner
5234c21e2f2SHugh Dickins# Heavily threaded applications may benefit from splitting the mm-wide
5244c21e2f2SHugh Dickins# page_table_lock, so that faults on different parts of the user address
5254c21e2f2SHugh Dickins# space can be handled with less contention: split it at this NR_CPUS.
5264c21e2f2SHugh Dickins# Default to 4 for wider testing, though 8 might be more appropriate.
5274c21e2f2SHugh Dickins# ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock.
5287b6ac9dfSHugh Dickins# PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes.
52960bccaa6SWill Deacon# SPARC32 allocates multiple pte tables within a single page, and therefore
53060bccaa6SWill Deacon# a per-page lock leads to problems when multiple tables need to be locked
53160bccaa6SWill Deacon# at the same time (e.g. copy_page_range()).
532a70caa8bSHugh Dickins# DEBUG_SPINLOCK and DEBUG_LOCK_ALLOC spinlock_t also enlarge struct page.
5334c21e2f2SHugh Dickins#
5344c21e2f2SHugh Dickinsconfig SPLIT_PTLOCK_CPUS
5354c21e2f2SHugh Dickins	int
5369164550eSKirill A. Shutemov	default "999999" if !MMU
537a70caa8bSHugh Dickins	default "999999" if ARM && !CPU_CACHE_VIPT
538a70caa8bSHugh Dickins	default "999999" if PARISC && !PA20
53960bccaa6SWill Deacon	default "999999" if SPARC32
5404c21e2f2SHugh Dickins	default "4"
5417cbe34cfSChristoph Lameter
542e009bb30SKirill A. Shutemovconfig ARCH_ENABLE_SPLIT_PMD_PTLOCK
5436341e62bSChristoph Jaeger	bool
544e009bb30SKirill A. Shutemov
5457cbe34cfSChristoph Lameter#
54609316c09SKonstantin Khlebnikov# support for memory balloon
54709316c09SKonstantin Khlebnikovconfig MEMORY_BALLOON
5486341e62bSChristoph Jaeger	bool
54909316c09SKonstantin Khlebnikov
55009316c09SKonstantin Khlebnikov#
55118468d93SRafael Aquini# support for memory balloon compaction
55218468d93SRafael Aquiniconfig BALLOON_COMPACTION
55318468d93SRafael Aquini	bool "Allow for balloon memory compaction/migration"
55418468d93SRafael Aquini	def_bool y
55509316c09SKonstantin Khlebnikov	depends on COMPACTION && MEMORY_BALLOON
55618468d93SRafael Aquini	help
55718468d93SRafael Aquini	  Memory fragmentation introduced by ballooning might reduce
55818468d93SRafael Aquini	  significantly the number of 2MB contiguous memory blocks that can be
55918468d93SRafael Aquini	  used within a guest, thus imposing performance penalties associated
56018468d93SRafael Aquini	  with the reduced number of transparent huge pages that could be used
56118468d93SRafael Aquini	  by the guest workload. Allowing the compaction & migration for memory
56218468d93SRafael Aquini	  pages enlisted as being part of memory balloon devices avoids the
56318468d93SRafael Aquini	  scenario aforementioned and helps improving memory defragmentation.
56418468d93SRafael Aquini
56518468d93SRafael Aquini#
566e9e96b39SMel Gorman# support for memory compaction
567e9e96b39SMel Gormanconfig COMPACTION
568e9e96b39SMel Gorman	bool "Allow for memory compaction"
56905106e6aSRik van Riel	def_bool y
570e9e96b39SMel Gorman	select MIGRATION
57133a93877SAndrea Arcangeli	depends on MMU
572e9e96b39SMel Gorman	help
573b32eaf71SMichal Hocko	  Compaction is the only memory management component to form
574b32eaf71SMichal Hocko	  high order (larger physically contiguous) memory blocks
575b32eaf71SMichal Hocko	  reliably. The page allocator relies on compaction heavily and
576b32eaf71SMichal Hocko	  the lack of the feature can lead to unexpected OOM killer
577b32eaf71SMichal Hocko	  invocations for high order memory requests. You shouldn't
578b32eaf71SMichal Hocko	  disable this option unless there really is a strong reason for
579b32eaf71SMichal Hocko	  it and then we would be really interested to hear about that at
580b32eaf71SMichal Hocko	  linux-mm@kvack.org.
581e9e96b39SMel Gorman
582e9e96b39SMel Gorman#
58336e66c55SAlexander Duyck# support for free page reporting
58436e66c55SAlexander Duyckconfig PAGE_REPORTING
58536e66c55SAlexander Duyck	bool "Free page reporting"
58636e66c55SAlexander Duyck	def_bool n
58736e66c55SAlexander Duyck	help
58836e66c55SAlexander Duyck	  Free page reporting allows for the incremental acquisition of
58936e66c55SAlexander Duyck	  free pages from the buddy allocator for the purpose of reporting
59036e66c55SAlexander Duyck	  those pages to another entity, such as a hypervisor, so that the
59136e66c55SAlexander Duyck	  memory can be freed within the host for other uses.
59236e66c55SAlexander Duyck
59336e66c55SAlexander Duyck#
5947cbe34cfSChristoph Lameter# support for page migration
5957cbe34cfSChristoph Lameter#
5967cbe34cfSChristoph Lameterconfig MIGRATION
597b20a3503SChristoph Lameter	bool "Page migration"
5986c5240aeSChristoph Lameter	def_bool y
599de32a817SChen Gang	depends on (NUMA || ARCH_ENABLE_MEMORY_HOTREMOVE || COMPACTION || CMA) && MMU
600b20a3503SChristoph Lameter	help
601b20a3503SChristoph Lameter	  Allows the migration of the physical location of pages of processes
602e9e96b39SMel Gorman	  while the virtual addresses are not changed. This is useful in
603e9e96b39SMel Gorman	  two situations. The first is on NUMA systems to put pages nearer
604e9e96b39SMel Gorman	  to the processors accessing. The second is when allocating huge
605e9e96b39SMel Gorman	  pages as migration can relocate pages to satisfy a huge page
606e9e96b39SMel Gorman	  allocation instead of reclaiming.
6076550e07fSGreg Kroah-Hartman
60876cbbeadSChristoph Hellwigconfig DEVICE_MIGRATION
609d90a25f8SChristoph Hellwig	def_bool MIGRATION && ZONE_DEVICE
61076cbbeadSChristoph Hellwig
611c177c81eSNaoya Horiguchiconfig ARCH_ENABLE_HUGEPAGE_MIGRATION
6126341e62bSChristoph Jaeger	bool
613c177c81eSNaoya Horiguchi
6149c670ea3SNaoya Horiguchiconfig ARCH_ENABLE_THP_MIGRATION
6159c670ea3SNaoya Horiguchi	bool
6169c670ea3SNaoya Horiguchi
6174bfb68a0SAnshuman Khandualconfig HUGETLB_PAGE_SIZE_VARIABLE
6184bfb68a0SAnshuman Khandual	def_bool n
6194bfb68a0SAnshuman Khandual	help
6204bfb68a0SAnshuman Khandual	  Allows the pageblock_order value to be dynamic instead of just standard
6214bfb68a0SAnshuman Khandual	  HUGETLB_PAGE_ORDER when there are multiple HugeTLB page sizes available
6224bfb68a0SAnshuman Khandual	  on a platform.
6234bfb68a0SAnshuman Khandual
624b3d40a2bSDavid Hildenbrand	  Note that the pageblock_order cannot exceed MAX_ORDER - 1 and will be
625b3d40a2bSDavid Hildenbrand	  clamped down to MAX_ORDER - 1.
626b3d40a2bSDavid Hildenbrand
6278df995f6SAlexandre Ghiticonfig CONTIG_ALLOC
6288df995f6SAlexandre Ghiti	def_bool (MEMORY_ISOLATION && COMPACTION) || CMA
6298df995f6SAlexandre Ghiti
630600715dcSJeremy Fitzhardingeconfig PHYS_ADDR_T_64BIT
631d4a451d5SChristoph Hellwig	def_bool 64BIT
632600715dcSJeremy Fitzhardinge
6332a7326b5SChristoph Lameterconfig BOUNCE
6349ca24e2eSVinayak Menon	bool "Enable bounce buffers"
6359ca24e2eSVinayak Menon	default y
636ce288e05SChristoph Hellwig	depends on BLOCK && MMU && HIGHMEM
6379ca24e2eSVinayak Menon	help
638ce288e05SChristoph Hellwig	  Enable bounce buffers for devices that cannot access the full range of
639ce288e05SChristoph Hellwig	  memory available to the CPU. Enabled by default when HIGHMEM is
640ce288e05SChristoph Hellwig	  selected, but you may say n to override this.
6412a7326b5SChristoph Lameter
642f057eac0SStephen Rothwellconfig VIRT_TO_BUS
6434febd95aSStephen Rothwell	bool
6444febd95aSStephen Rothwell	help
6454febd95aSStephen Rothwell	  An architecture should select this if it implements the
6464febd95aSStephen Rothwell	  deprecated interface virt_to_bus().  All new architectures
6474febd95aSStephen Rothwell	  should probably not select this.
6484febd95aSStephen Rothwell
649cddb8a5cSAndrea Arcangeli
650cddb8a5cSAndrea Arcangeliconfig MMU_NOTIFIER
651cddb8a5cSAndrea Arcangeli	bool
65283fe27eaSPranith Kumar	select SRCU
65399cb252fSJason Gunthorpe	select INTERVAL_TREE
654fc4d5c29SDavid Howells
655f8af4da3SHugh Dickinsconfig KSM
656f8af4da3SHugh Dickins	bool "Enable KSM for page merging"
657f8af4da3SHugh Dickins	depends on MMU
65859e1a2f4STimofey Titovets	select XXHASH
659f8af4da3SHugh Dickins	help
660f8af4da3SHugh Dickins	  Enable Kernel Samepage Merging: KSM periodically scans those areas
661f8af4da3SHugh Dickins	  of an application's address space that an app has advised may be
662f8af4da3SHugh Dickins	  mergeable.  When it finds pages of identical content, it replaces
663d0f209f6SHugh Dickins	  the many instances by a single page with that content, so
664f8af4da3SHugh Dickins	  saving memory until one or another app needs to modify the content.
665f8af4da3SHugh Dickins	  Recommended for use with KVM, or with other duplicative applications.
666ad56b738SMike Rapoport	  See Documentation/vm/ksm.rst for more information: KSM is inactive
667c73602adSHugh Dickins	  until a program has madvised that an area is MADV_MERGEABLE, and
668c73602adSHugh Dickins	  root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
669f8af4da3SHugh Dickins
670e0a94c2aSChristoph Lameterconfig DEFAULT_MMAP_MIN_ADDR
671e0a94c2aSChristoph Lameter	int "Low address space to protect from user allocation"
6726e141546SDavid Howells	depends on MMU
673e0a94c2aSChristoph Lameter	default 4096
674e0a94c2aSChristoph Lameter	help
675e0a94c2aSChristoph Lameter	  This is the portion of low virtual memory which should be protected
676e0a94c2aSChristoph Lameter	  from userspace allocation.  Keeping a user from writing to low pages
677e0a94c2aSChristoph Lameter	  can help reduce the impact of kernel NULL pointer bugs.
678e0a94c2aSChristoph Lameter
679e0a94c2aSChristoph Lameter	  For most ia64, ppc64 and x86 users with lots of address space
680e0a94c2aSChristoph Lameter	  a value of 65536 is reasonable and should cause no problems.
681e0a94c2aSChristoph Lameter	  On arm and other archs it should not be higher than 32768.
682788084abSEric Paris	  Programs which use vm86 functionality or have some need to map
683788084abSEric Paris	  this low address space will need CAP_SYS_RAWIO or disable this
684788084abSEric Paris	  protection by setting the value to 0.
685e0a94c2aSChristoph Lameter
686e0a94c2aSChristoph Lameter	  This value can be changed after boot using the
687e0a94c2aSChristoph Lameter	  /proc/sys/vm/mmap_min_addr tunable.
688e0a94c2aSChristoph Lameter
689d949f36fSLinus Torvaldsconfig ARCH_SUPPORTS_MEMORY_FAILURE
690d949f36fSLinus Torvalds	bool
691e0a94c2aSChristoph Lameter
6926a46079cSAndi Kleenconfig MEMORY_FAILURE
6936a46079cSAndi Kleen	depends on MMU
694d949f36fSLinus Torvalds	depends on ARCH_SUPPORTS_MEMORY_FAILURE
6956a46079cSAndi Kleen	bool "Enable recovery from hardware memory errors"
696ee6f509cSMinchan Kim	select MEMORY_ISOLATION
69797f0b134SXie XiuQi	select RAS
6986a46079cSAndi Kleen	help
6996a46079cSAndi Kleen	  Enables code to recover from some memory failures on systems
7006a46079cSAndi Kleen	  with MCA recovery. This allows a system to continue running
7016a46079cSAndi Kleen	  even when some of its memory has uncorrected errors. This requires
7026a46079cSAndi Kleen	  special hardware support and typically ECC memory.
7036a46079cSAndi Kleen
704cae681fcSAndi Kleenconfig HWPOISON_INJECT
705413f9efbSAndi Kleen	tristate "HWPoison pages injector"
70627df5068SAndi Kleen	depends on MEMORY_FAILURE && DEBUG_KERNEL && PROC_FS
707478c5ffcSWu Fengguang	select PROC_PAGE_MONITOR
708cae681fcSAndi Kleen
709fc4d5c29SDavid Howellsconfig NOMMU_INITIAL_TRIM_EXCESS
710fc4d5c29SDavid Howells	int "Turn on mmap() excess space trimming before booting"
711fc4d5c29SDavid Howells	depends on !MMU
712fc4d5c29SDavid Howells	default 1
713fc4d5c29SDavid Howells	help
714fc4d5c29SDavid Howells	  The NOMMU mmap() frequently needs to allocate large contiguous chunks
715fc4d5c29SDavid Howells	  of memory on which to store mappings, but it can only ask the system
716fc4d5c29SDavid Howells	  allocator for chunks in 2^N*PAGE_SIZE amounts - which is frequently
717fc4d5c29SDavid Howells	  more than it requires.  To deal with this, mmap() is able to trim off
718fc4d5c29SDavid Howells	  the excess and return it to the allocator.
719fc4d5c29SDavid Howells
720fc4d5c29SDavid Howells	  If trimming is enabled, the excess is trimmed off and returned to the
721fc4d5c29SDavid Howells	  system allocator, which can cause extra fragmentation, particularly
722fc4d5c29SDavid Howells	  if there are a lot of transient processes.
723fc4d5c29SDavid Howells
724fc4d5c29SDavid Howells	  If trimming is disabled, the excess is kept, but not used, which for
725fc4d5c29SDavid Howells	  long-term mappings means that the space is wasted.
726fc4d5c29SDavid Howells
727fc4d5c29SDavid Howells	  Trimming can be dynamically controlled through a sysctl option
728fc4d5c29SDavid Howells	  (/proc/sys/vm/nr_trim_pages) which specifies the minimum number of
729fc4d5c29SDavid Howells	  excess pages there must be before trimming should occur, or zero if
730fc4d5c29SDavid Howells	  no trimming is to occur.
731fc4d5c29SDavid Howells
732fc4d5c29SDavid Howells	  This option specifies the initial value of this option.  The default
733fc4d5c29SDavid Howells	  of 1 says that all excess pages should be trimmed.
734fc4d5c29SDavid Howells
735dd19d293SStephen Kitt	  See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
736bbddff05STejun Heo
737519bcb79SJohannes Weinerconfig ARCH_WANT_GENERAL_HUGETLB
738519bcb79SJohannes Weiner	bool
739519bcb79SJohannes Weiner
740519bcb79SJohannes Weinerconfig ARCH_WANTS_THP_SWAP
741519bcb79SJohannes Weiner	def_bool n
742519bcb79SJohannes Weiner
743519bcb79SJohannes Weinermenuconfig TRANSPARENT_HUGEPAGE
74413ece886SAndrea Arcangeli	bool "Transparent Hugepage Support"
745554b0f3cSSebastian Andrzej Siewior	depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT
7465d689240SAndrea Arcangeli	select COMPACTION
7473a08cd52SMatthew Wilcox	select XARRAY_MULTI
7484c76d9d1SAndrea Arcangeli	help
7494c76d9d1SAndrea Arcangeli	  Transparent Hugepages allows the kernel to use huge pages and
7504c76d9d1SAndrea Arcangeli	  huge tlb transparently to the applications whenever possible.
7514c76d9d1SAndrea Arcangeli	  This feature can improve computing performance to certain
7524c76d9d1SAndrea Arcangeli	  applications by speeding up page faults during memory
7534c76d9d1SAndrea Arcangeli	  allocation, by reducing the number of tlb misses and by speeding
7544c76d9d1SAndrea Arcangeli	  up the pagetable walking.
7554c76d9d1SAndrea Arcangeli
7564c76d9d1SAndrea Arcangeli	  If memory constrained on embedded, you may want to say N.
7574c76d9d1SAndrea Arcangeli
758519bcb79SJohannes Weinerif TRANSPARENT_HUGEPAGE
759519bcb79SJohannes Weiner
76013ece886SAndrea Arcangelichoice
76113ece886SAndrea Arcangeli	prompt "Transparent Hugepage Support sysfs defaults"
76213ece886SAndrea Arcangeli	depends on TRANSPARENT_HUGEPAGE
76313ece886SAndrea Arcangeli	default TRANSPARENT_HUGEPAGE_ALWAYS
76413ece886SAndrea Arcangeli	help
76513ece886SAndrea Arcangeli	  Selects the sysfs defaults for Transparent Hugepage Support.
76613ece886SAndrea Arcangeli
76713ece886SAndrea Arcangeli	config TRANSPARENT_HUGEPAGE_ALWAYS
76813ece886SAndrea Arcangeli		bool "always"
76913ece886SAndrea Arcangeli	help
77013ece886SAndrea Arcangeli	  Enabling Transparent Hugepage always, can increase the
77113ece886SAndrea Arcangeli	  memory footprint of applications without a guaranteed
77213ece886SAndrea Arcangeli	  benefit but it will work automatically for all applications.
77313ece886SAndrea Arcangeli
77413ece886SAndrea Arcangeli	config TRANSPARENT_HUGEPAGE_MADVISE
77513ece886SAndrea Arcangeli		bool "madvise"
77613ece886SAndrea Arcangeli	help
77713ece886SAndrea Arcangeli	  Enabling Transparent Hugepage madvise, will only provide a
77813ece886SAndrea Arcangeli	  performance improvement benefit to the applications using
77913ece886SAndrea Arcangeli	  madvise(MADV_HUGEPAGE) but it won't risk to increase the
78013ece886SAndrea Arcangeli	  memory footprint of applications without a guaranteed
78113ece886SAndrea Arcangeli	  benefit.
78213ece886SAndrea Arcangeliendchoice
78313ece886SAndrea Arcangeli
78438d8b4e6SHuang Yingconfig THP_SWAP
78538d8b4e6SHuang Ying	def_bool y
78614fef284SHuang Ying	depends on TRANSPARENT_HUGEPAGE && ARCH_WANTS_THP_SWAP && SWAP
78738d8b4e6SHuang Ying	help
78838d8b4e6SHuang Ying	  Swap transparent huge pages in one piece, without splitting.
78914fef284SHuang Ying	  XXX: For now, swap cluster backing transparent huge page
79014fef284SHuang Ying	  will be split after swapout.
79138d8b4e6SHuang Ying
79238d8b4e6SHuang Ying	  For selection by architectures with reasonable THP sizes.
79338d8b4e6SHuang Ying
794519bcb79SJohannes Weinerconfig READ_ONLY_THP_FOR_FS
795519bcb79SJohannes Weiner	bool "Read-only THP for filesystems (EXPERIMENTAL)"
796519bcb79SJohannes Weiner	depends on TRANSPARENT_HUGEPAGE && SHMEM
797519bcb79SJohannes Weiner
798519bcb79SJohannes Weiner	help
799519bcb79SJohannes Weiner	  Allow khugepaged to put read-only file-backed pages in THP.
800519bcb79SJohannes Weiner
801519bcb79SJohannes Weiner	  This is marked experimental because it is a new feature. Write
802519bcb79SJohannes Weiner	  support of file THPs will be developed in the next few release
803519bcb79SJohannes Weiner	  cycles.
804519bcb79SJohannes Weiner
805519bcb79SJohannes Weinerendif # TRANSPARENT_HUGEPAGE
806519bcb79SJohannes Weiner
807e496cf3dSKirill A. Shutemov#
808bbddff05STejun Heo# UP and nommu archs use km based percpu allocator
809bbddff05STejun Heo#
810bbddff05STejun Heoconfig NEED_PER_CPU_KM
8113583521aSVladimir Murzin	depends on !SMP || !MMU
812bbddff05STejun Heo	bool
813bbddff05STejun Heo	default y
814077b1f83SDan Magenheimer
8157ecd19cfSKefeng Wangconfig NEED_PER_CPU_EMBED_FIRST_CHUNK
8167ecd19cfSKefeng Wang	bool
8177ecd19cfSKefeng Wang
8187ecd19cfSKefeng Wangconfig NEED_PER_CPU_PAGE_FIRST_CHUNK
8197ecd19cfSKefeng Wang	bool
8207ecd19cfSKefeng Wang
8217ecd19cfSKefeng Wangconfig USE_PERCPU_NUMA_NODE_ID
8227ecd19cfSKefeng Wang	bool
8237ecd19cfSKefeng Wang
8247ecd19cfSKefeng Wangconfig HAVE_SETUP_PER_CPU_AREA
8257ecd19cfSKefeng Wang	bool
8267ecd19cfSKefeng Wang
82727c6aec2SDan Magenheimerconfig FRONTSWAP
8286e61dde8SChristoph Hellwig	bool
829f825c736SAneesh Kumar K.V
830f825c736SAneesh Kumar K.Vconfig CMA
831f825c736SAneesh Kumar K.V	bool "Contiguous Memory Allocator"
832aca52c39SMike Rapoport	depends on MMU
833f825c736SAneesh Kumar K.V	select MIGRATION
834f825c736SAneesh Kumar K.V	select MEMORY_ISOLATION
835f825c736SAneesh Kumar K.V	help
836f825c736SAneesh Kumar K.V	  This enables the Contiguous Memory Allocator which allows other
837f825c736SAneesh Kumar K.V	  subsystems to allocate big physically-contiguous blocks of memory.
838f825c736SAneesh Kumar K.V	  CMA reserves a region of memory and allows only movable pages to
839f825c736SAneesh Kumar K.V	  be allocated from it. This way, the kernel can use the memory for
840f825c736SAneesh Kumar K.V	  pagecache and when a subsystem requests for contiguous area, the
841f825c736SAneesh Kumar K.V	  allocated pages are migrated away to serve the contiguous request.
842f825c736SAneesh Kumar K.V
843f825c736SAneesh Kumar K.V	  If unsure, say "n".
844f825c736SAneesh Kumar K.V
845f825c736SAneesh Kumar K.Vconfig CMA_DEBUG
846f825c736SAneesh Kumar K.V	bool "CMA debug messages (DEVELOPMENT)"
847f825c736SAneesh Kumar K.V	depends on DEBUG_KERNEL && CMA
848f825c736SAneesh Kumar K.V	help
849f825c736SAneesh Kumar K.V	  Turns on debug messages in CMA.  This produces KERN_DEBUG
850f825c736SAneesh Kumar K.V	  messages for every CMA call as well as various messages while
851f825c736SAneesh Kumar K.V	  processing calls such as dma_alloc_from_contiguous().
852f825c736SAneesh Kumar K.V	  This option does not affect warning and error messages.
853bf550fc9SAlexander Graf
85428b24c1fSSasha Levinconfig CMA_DEBUGFS
85528b24c1fSSasha Levin	bool "CMA debugfs interface"
85628b24c1fSSasha Levin	depends on CMA && DEBUG_FS
85728b24c1fSSasha Levin	help
85828b24c1fSSasha Levin	  Turns on the DebugFS interface for CMA.
85928b24c1fSSasha Levin
86043ca106fSMinchan Kimconfig CMA_SYSFS
86143ca106fSMinchan Kim	bool "CMA information through sysfs interface"
86243ca106fSMinchan Kim	depends on CMA && SYSFS
86343ca106fSMinchan Kim	help
86443ca106fSMinchan Kim	  This option exposes some sysfs attributes to get information
86543ca106fSMinchan Kim	  from CMA.
86643ca106fSMinchan Kim
867a254129eSJoonsoo Kimconfig CMA_AREAS
868a254129eSJoonsoo Kim	int "Maximum count of the CMA areas"
869a254129eSJoonsoo Kim	depends on CMA
870b7176c26SBarry Song	default 19 if NUMA
871a254129eSJoonsoo Kim	default 7
872a254129eSJoonsoo Kim	help
873a254129eSJoonsoo Kim	  CMA allows to create CMA areas for particular purpose, mainly,
874a254129eSJoonsoo Kim	  used as device private area. This parameter sets the maximum
875a254129eSJoonsoo Kim	  number of CMA area in the system.
876a254129eSJoonsoo Kim
877b7176c26SBarry Song	  If unsure, leave the default value "7" in UMA and "19" in NUMA.
878a254129eSJoonsoo Kim
879af8d417aSDan Streetmanconfig MEM_SOFT_DIRTY
880af8d417aSDan Streetman	bool "Track memory changes"
881af8d417aSDan Streetman	depends on CHECKPOINT_RESTORE && HAVE_ARCH_SOFT_DIRTY && PROC_FS
882af8d417aSDan Streetman	select PROC_PAGE_MONITOR
8834e2e2770SSeth Jennings	help
884af8d417aSDan Streetman	  This option enables memory changes tracking by introducing a
885af8d417aSDan Streetman	  soft-dirty bit on pte-s. This bit it set when someone writes
886af8d417aSDan Streetman	  into a page just as regular dirty bit, but unlike the latter
887af8d417aSDan Streetman	  it can be cleared by hands.
888af8d417aSDan Streetman
8891ad1335dSMike Rapoport	  See Documentation/admin-guide/mm/soft-dirty.rst for more details.
8904e2e2770SSeth Jennings
8919e5c33d7SMark Salterconfig GENERIC_EARLY_IOREMAP
8929e5c33d7SMark Salter	bool
893042d27acSHelge Deller
89422ee3ea5SHelge Dellerconfig STACK_MAX_DEFAULT_SIZE_MB
89522ee3ea5SHelge Deller	int "Default maximum user stack size for 32-bit processes (MB)"
89622ee3ea5SHelge Deller	default 100
897042d27acSHelge Deller	range 8 2048
898042d27acSHelge Deller	depends on STACK_GROWSUP && (!64BIT || COMPAT)
899042d27acSHelge Deller	help
900042d27acSHelge Deller	  This is the maximum stack size in Megabytes in the VM layout of 32-bit
901042d27acSHelge Deller	  user processes when the stack grows upwards (currently only on parisc
90222ee3ea5SHelge Deller	  arch) when the RLIMIT_STACK hard limit is unlimited.
903042d27acSHelge Deller
90422ee3ea5SHelge Deller	  A sane initial value is 100 MB.
9053a80a7faSMel Gorman
9063a80a7faSMel Gormanconfig DEFERRED_STRUCT_PAGE_INIT
9071ce22103SVlastimil Babka	bool "Defer initialisation of struct pages to kthreads"
908d39f8fb4SMike Rapoport	depends on SPARSEMEM
909ab1e8d89SPavel Tatashin	depends on !NEED_PER_CPU_KM
910889c695dSPasha Tatashin	depends on 64BIT
911e4443149SDaniel Jordan	select PADATA
9123a80a7faSMel Gorman	help
9133a80a7faSMel Gorman	  Ordinarily all struct pages are initialised during early boot in a
9143a80a7faSMel Gorman	  single thread. On very large machines this can take a considerable
9153a80a7faSMel Gorman	  amount of time. If this option is set, large machines will bring up
916e4443149SDaniel Jordan	  a subset of memmap at boot and then initialise the rest in parallel.
917e4443149SDaniel Jordan	  This has a potential performance impact on tasks running early in the
9181ce22103SVlastimil Babka	  lifetime of the system until these kthreads finish the
9191ce22103SVlastimil Babka	  initialisation.
920033fbae9SDan Williams
9211c676e0dSSeongJae Parkconfig PAGE_IDLE_FLAG
9221c676e0dSSeongJae Park	bool
9231c676e0dSSeongJae Park	select PAGE_EXTENSION if !64BIT
9241c676e0dSSeongJae Park	help
9251c676e0dSSeongJae Park	  This adds PG_idle and PG_young flags to 'struct page'.  PTE Accessed
9261c676e0dSSeongJae Park	  bit writers can set the state of the bit in the flags so that PTE
9271c676e0dSSeongJae Park	  Accessed bit readers may avoid disturbance.
9281c676e0dSSeongJae Park
92933c3fc71SVladimir Davydovconfig IDLE_PAGE_TRACKING
93033c3fc71SVladimir Davydov	bool "Enable idle page tracking"
93133c3fc71SVladimir Davydov	depends on SYSFS && MMU
9321c676e0dSSeongJae Park	select PAGE_IDLE_FLAG
93333c3fc71SVladimir Davydov	help
93433c3fc71SVladimir Davydov	  This feature allows to estimate the amount of user pages that have
93533c3fc71SVladimir Davydov	  not been touched during a given period of time. This information can
93633c3fc71SVladimir Davydov	  be useful to tune memory cgroup limits and/or for job placement
93733c3fc71SVladimir Davydov	  within a compute cluster.
93833c3fc71SVladimir Davydov
9391ad1335dSMike Rapoport	  See Documentation/admin-guide/mm/idle_page_tracking.rst for
9401ad1335dSMike Rapoport	  more details.
94133c3fc71SVladimir Davydov
942c2280be8SAnshuman Khandualconfig ARCH_HAS_CACHE_LINE_SIZE
943c2280be8SAnshuman Khandual	bool
944c2280be8SAnshuman Khandual
9452792d84eSKees Cookconfig ARCH_HAS_CURRENT_STACK_POINTER
9462792d84eSKees Cook	bool
9472792d84eSKees Cook	help
9482792d84eSKees Cook	  In support of HARDENED_USERCOPY performing stack variable lifetime
9492792d84eSKees Cook	  checking, an architecture-agnostic way to find the stack pointer
9502792d84eSKees Cook	  is needed. Once an architecture defines an unsigned long global
9512792d84eSKees Cook	  register alias named "current_stack_pointer", this config can be
9522792d84eSKees Cook	  selected.
9532792d84eSKees Cook
95467436193SAnshuman Khandualconfig ARCH_HAS_VM_GET_PAGE_PROT
95567436193SAnshuman Khandual	bool
95667436193SAnshuman Khandual
95717596731SRobin Murphyconfig ARCH_HAS_PTE_DEVMAP
95865f7d049SOliver O'Halloran	bool
95965f7d049SOliver O'Halloran
96063703f37SKefeng Wangconfig ARCH_HAS_ZONE_DMA_SET
96163703f37SKefeng Wang	bool
96263703f37SKefeng Wang
96363703f37SKefeng Wangconfig ZONE_DMA
96463703f37SKefeng Wang	bool "Support DMA zone" if ARCH_HAS_ZONE_DMA_SET
96563703f37SKefeng Wang	default y if ARM64 || X86
96663703f37SKefeng Wang
96763703f37SKefeng Wangconfig ZONE_DMA32
96863703f37SKefeng Wang	bool "Support DMA32 zone" if ARCH_HAS_ZONE_DMA_SET
96963703f37SKefeng Wang	depends on !X86_32
97063703f37SKefeng Wang	default y if ARM64
97163703f37SKefeng Wang
972033fbae9SDan Williamsconfig ZONE_DEVICE
9735042db43SJérôme Glisse	bool "Device memory (pmem, HMM, etc...) hotplug support"
974033fbae9SDan Williams	depends on MEMORY_HOTPLUG
975033fbae9SDan Williams	depends on MEMORY_HOTREMOVE
97699490f16SDan Williams	depends on SPARSEMEM_VMEMMAP
97717596731SRobin Murphy	depends on ARCH_HAS_PTE_DEVMAP
9783a08cd52SMatthew Wilcox	select XARRAY_MULTI
979033fbae9SDan Williams
980033fbae9SDan Williams	help
981033fbae9SDan Williams	  Device memory hotplug support allows for establishing pmem,
982033fbae9SDan Williams	  or other device driver discovered memory regions, in the
983033fbae9SDan Williams	  memmap. This allows pfn_to_page() lookups of otherwise
984033fbae9SDan Williams	  "device-physical" addresses which is needed for using a DAX
985033fbae9SDan Williams	  mapping in an O_DIRECT operation, among other things.
986033fbae9SDan Williams
987033fbae9SDan Williams	  If FS_DAX is enabled, then say Y.
98806a660adSLinus Torvalds
9899c240a7bSChristoph Hellwig#
9909c240a7bSChristoph Hellwig# Helpers to mirror range of the CPU page tables of a process into device page
9919c240a7bSChristoph Hellwig# tables.
9929c240a7bSChristoph Hellwig#
993c0b12405SJérôme Glisseconfig HMM_MIRROR
9949c240a7bSChristoph Hellwig	bool
995f442c283SChristoph Hellwig	depends on MMU
996c0b12405SJérôme Glisse
9975042db43SJérôme Glisseconfig DEVICE_PRIVATE
9985042db43SJérôme Glisse	bool "Unaddressable device memory (GPU memory, ...)"
9997328d9ccSChristoph Hellwig	depends on ZONE_DEVICE
10005042db43SJérôme Glisse
10015042db43SJérôme Glisse	help
10025042db43SJérôme Glisse	  Allows creation of struct pages to represent unaddressable device
10035042db43SJérôme Glisse	  memory; i.e., memory that is only accessible from the device (or
10045042db43SJérôme Glisse	  group of devices). You likely also want to select HMM_MIRROR.
10055042db43SJérôme Glisse
10063e9a9e25SChristoph Hellwigconfig VMAP_PFN
10073e9a9e25SChristoph Hellwig	bool
10083e9a9e25SChristoph Hellwig
100963c17fb8SDave Hansenconfig ARCH_USES_HIGH_VMA_FLAGS
101063c17fb8SDave Hansen	bool
101166d37570SDave Hansenconfig ARCH_HAS_PKEYS
101266d37570SDave Hansen	bool
101330a5b536SDennis Zhou
1014*0710d012SVlastimil Babkaconfig VM_EVENT_COUNTERS
1015*0710d012SVlastimil Babka	default y
1016*0710d012SVlastimil Babka	bool "Enable VM event counters for /proc/vmstat" if EXPERT
1017*0710d012SVlastimil Babka	help
1018*0710d012SVlastimil Babka	  VM event counters are needed for event counts to be shown.
1019*0710d012SVlastimil Babka	  This option allows the disabling of the VM event counters
1020*0710d012SVlastimil Babka	  on EXPERT systems.  /proc/vmstat will only show page counts
1021*0710d012SVlastimil Babka	  if VM event counters are disabled.
1022*0710d012SVlastimil Babka
102330a5b536SDennis Zhouconfig PERCPU_STATS
102430a5b536SDennis Zhou	bool "Collect percpu memory statistics"
102530a5b536SDennis Zhou	help
102630a5b536SDennis Zhou	  This feature collects and exposes statistics via debugfs. The
102730a5b536SDennis Zhou	  information includes global and per chunk statistics, which can
102830a5b536SDennis Zhou	  be used to help understand percpu memory usage.
102964c349f4SKirill A. Shutemov
10309c84f229SJohn Hubbardconfig GUP_TEST
10319c84f229SJohn Hubbard	bool "Enable infrastructure for get_user_pages()-related unit tests"
1032d0de8241SBarry Song	depends on DEBUG_FS
103364c349f4SKirill A. Shutemov	help
10349c84f229SJohn Hubbard	  Provides /sys/kernel/debug/gup_test, which in turn provides a way
10359c84f229SJohn Hubbard	  to make ioctl calls that can launch kernel-based unit tests for
10369c84f229SJohn Hubbard	  the get_user_pages*() and pin_user_pages*() family of API calls.
103764c349f4SKirill A. Shutemov
10389c84f229SJohn Hubbard	  These tests include benchmark testing of the _fast variants of
10399c84f229SJohn Hubbard	  get_user_pages*() and pin_user_pages*(), as well as smoke tests of
10409c84f229SJohn Hubbard	  the non-_fast variants.
10419c84f229SJohn Hubbard
1042f4f9bda4SJohn Hubbard	  There is also a sub-test that allows running dump_page() on any
1043f4f9bda4SJohn Hubbard	  of up to eight pages (selected by command line args) within the
1044f4f9bda4SJohn Hubbard	  range of user-space addresses. These pages are either pinned via
1045f4f9bda4SJohn Hubbard	  pin_user_pages*(), or pinned via get_user_pages*(), as specified
1046f4f9bda4SJohn Hubbard	  by other command line arguments.
1047f4f9bda4SJohn Hubbard
10489c84f229SJohn Hubbard	  See tools/testing/selftests/vm/gup_test.c
10493010a5eaSLaurent Dufour
1050d0de8241SBarry Songcomment "GUP_TEST needs to have DEBUG_FS enabled"
1051d0de8241SBarry Song	depends on !GUP_TEST && !DEBUG_FS
10523010a5eaSLaurent Dufour
105339656e83SChristoph Hellwigconfig GUP_GET_PTE_LOW_HIGH
105439656e83SChristoph Hellwig	bool
105539656e83SChristoph Hellwig
10563010a5eaSLaurent Dufourconfig ARCH_HAS_PTE_SPECIAL
10573010a5eaSLaurent Dufour	bool
105859e0b520SChristoph Hellwig
1059cbd34da7SChristoph Hellwig#
1060cbd34da7SChristoph Hellwig# Some architectures require a special hugepage directory format that is
1061cbd34da7SChristoph Hellwig# required to support multiple hugepage sizes. For example a4fe3ce76
1062cbd34da7SChristoph Hellwig# "powerpc/mm: Allow more flexible layouts for hugepage pagetables"
1063cbd34da7SChristoph Hellwig# introduced it on powerpc.  This allows for a more flexible hugepage
1064cbd34da7SChristoph Hellwig# pagetable layouts.
1065cbd34da7SChristoph Hellwig#
1066cbd34da7SChristoph Hellwigconfig ARCH_HAS_HUGEPD
1067cbd34da7SChristoph Hellwig	bool
1068cbd34da7SChristoph Hellwig
1069c5acad84SThomas Hellstromconfig MAPPING_DIRTY_HELPERS
1070c5acad84SThomas Hellstrom        bool
1071c5acad84SThomas Hellstrom
1072298fa1adSThomas Gleixnerconfig KMAP_LOCAL
1073298fa1adSThomas Gleixner	bool
1074298fa1adSThomas Gleixner
1075825c43f5SArd Biesheuvelconfig KMAP_LOCAL_NON_LINEAR_PTE_ARRAY
1076825c43f5SArd Biesheuvel	bool
1077825c43f5SArd Biesheuvel
10781fbaf8fcSChristoph Hellwig# struct io_mapping based helper.  Selected by drivers that need them
10791fbaf8fcSChristoph Hellwigconfig IO_MAPPING
10801fbaf8fcSChristoph Hellwig	bool
10811507f512SMike Rapoport
10821507f512SMike Rapoportconfig SECRETMEM
10831507f512SMike Rapoport	def_bool ARCH_HAS_SET_DIRECT_MAP && !EMBEDDED
10841507f512SMike Rapoport
10859a10064fSColin Crossconfig ANON_VMA_NAME
10869a10064fSColin Cross	bool "Anonymous VMA name support"
10879a10064fSColin Cross	depends on PROC_FS && ADVISE_SYSCALLS && MMU
10889a10064fSColin Cross
10899a10064fSColin Cross	help
10909a10064fSColin Cross	  Allow naming anonymous virtual memory areas.
10919a10064fSColin Cross
10929a10064fSColin Cross	  This feature allows assigning names to virtual memory areas. Assigned
10939a10064fSColin Cross	  names can be later retrieved from /proc/pid/maps and /proc/pid/smaps
10949a10064fSColin Cross	  and help identifying individual anonymous memory areas.
10959a10064fSColin Cross	  Assigning a name to anonymous virtual memory area might prevent that
10969a10064fSColin Cross	  area from being merged with adjacent virtual memory areas due to the
10979a10064fSColin Cross	  difference in their name.
10989a10064fSColin Cross
1099430529b5SPeter Xuconfig USERFAULTFD
1100430529b5SPeter Xu	bool "Enable userfaultfd() system call"
1101430529b5SPeter Xu	depends on MMU
1102430529b5SPeter Xu	help
1103430529b5SPeter Xu	  Enable the userfaultfd() system call that allows to intercept and
1104430529b5SPeter Xu	  handle page faults in userland.
1105430529b5SPeter Xu
1106430529b5SPeter Xuconfig HAVE_ARCH_USERFAULTFD_WP
1107430529b5SPeter Xu	bool
1108430529b5SPeter Xu	help
1109430529b5SPeter Xu	  Arch has userfaultfd write protection support
1110430529b5SPeter Xu
1111430529b5SPeter Xuconfig HAVE_ARCH_USERFAULTFD_MINOR
1112430529b5SPeter Xu	bool
1113430529b5SPeter Xu	help
1114430529b5SPeter Xu	  Arch has userfaultfd minor fault support
1115430529b5SPeter Xu
1116679d1033SPeter Xuconfig PTE_MARKER
111781e0f15fSPeter Xu	bool
1118679d1033SPeter Xu
1119679d1033SPeter Xu	help
1120679d1033SPeter Xu	  Allows to create marker PTEs for file-backed memory.
1121679d1033SPeter Xu
11221db9dbc2SPeter Xuconfig PTE_MARKER_UFFD_WP
112381e0f15fSPeter Xu	bool "Userfaultfd write protection support for shmem/hugetlbfs"
112481e0f15fSPeter Xu	default y
112581e0f15fSPeter Xu	depends on HAVE_ARCH_USERFAULTFD_WP
112681e0f15fSPeter Xu	select PTE_MARKER
11271db9dbc2SPeter Xu
11281db9dbc2SPeter Xu	help
11291db9dbc2SPeter Xu	  Allows to create marker PTEs for userfaultfd write protection
11301db9dbc2SPeter Xu	  purposes.  It is required to enable userfaultfd write protection on
11311db9dbc2SPeter Xu	  file-backed memory types like shmem and hugetlbfs.
11321db9dbc2SPeter Xu
11332224d848SSeongJae Parksource "mm/damon/Kconfig"
11342224d848SSeongJae Park
113559e0b520SChristoph Hellwigendmenu
1136