mm/slab: remove CONFIG_SLAB from all Kconfig and Makefile
[linux-2.6-block.git] / mm / Kconfig
CommitLineData
ec8f24b7 1# SPDX-License-Identifier: GPL-2.0-only
59e0b520
CH
2
3menu "Memory Management options"
4
7b42f104
JW
5#
6# For some reason microblaze and nios2 hard code SWAP=n. Hopefully we can
7# add proper SWAP support to them, in which case this can be remove.
8#
9config ARCH_NO_SWAP
10 bool
11
b3fbd58f
JW
12config ZPOOL
13 bool
14
519bcb79 15menuconfig SWAP
7b42f104
JW
16 bool "Support for paging of anonymous memory (swap)"
17 depends on MMU && BLOCK && !ARCH_NO_SWAP
18 default y
19 help
20 This option allows you to choose whether you want to have support
21 for so called swap devices or swap files in your kernel that are
22 used to provide more virtual memory than the actual RAM present
23 in your computer. If unsure say Y.
24
519bcb79 25config ZSWAP
fcab9b44 26 bool "Compressed cache for swap pages"
b3fbd58f 27 depends on SWAP
b3fbd58f 28 select CRYPTO
519bcb79
JW
29 select ZPOOL
30 help
31 A lightweight compressed cache for swap pages. It takes
32 pages that are in the process of being swapped out and attempts to
33 compress them into a dynamically allocated RAM-based memory pool.
34 This can result in a significant I/O reduction on swap device and,
1a44131d 35 in the case where decompressing from RAM is faster than swap device
519bcb79
JW
36 reads, can also improve workload performance.
37
b3fbd58f
JW
38config ZSWAP_DEFAULT_ON
39 bool "Enable the compressed cache for swap pages by default"
40 depends on ZSWAP
41 help
42 If selected, the compressed cache for swap pages will be enabled
43 at boot, otherwise it will be disabled.
44
45 The selection made here can be overridden by using the kernel
46 command line 'zswap.enabled=' option.
47
b9c91c43
YA
48config ZSWAP_EXCLUSIVE_LOADS_DEFAULT_ON
49 bool "Invalidate zswap entries when pages are loaded"
50 depends on ZSWAP
51 help
52 If selected, exclusive loads for zswap will be enabled at boot,
53 otherwise it will be disabled.
54
55 If exclusive loads are enabled, when a page is loaded from zswap,
56 the zswap entry is invalidated at once, as opposed to leaving it
57 in zswap until the swap entry is freed.
58
59 This avoids having two copies of the same page in memory
60 (compressed and uncompressed) after faulting in a page from zswap.
61 The cost is that if the page was never dirtied and needs to be
62 swapped out again, it will be re-compressed.
63
519bcb79 64choice
b3fbd58f 65 prompt "Default compressor"
519bcb79
JW
66 depends on ZSWAP
67 default ZSWAP_COMPRESSOR_DEFAULT_LZO
68 help
69 Selects the default compression algorithm for the compressed cache
70 for swap pages.
71
72 For an overview what kind of performance can be expected from
73 a particular compression algorithm please refer to the benchmarks
74 available at the following LWN page:
75 https://lwn.net/Articles/751795/
76
77 If in doubt, select 'LZO'.
78
79 The selection made here can be overridden by using the kernel
80 command line 'zswap.compressor=' option.
81
82config ZSWAP_COMPRESSOR_DEFAULT_DEFLATE
83 bool "Deflate"
84 select CRYPTO_DEFLATE
85 help
86 Use the Deflate algorithm as the default compression algorithm.
87
88config ZSWAP_COMPRESSOR_DEFAULT_LZO
89 bool "LZO"
90 select CRYPTO_LZO
91 help
92 Use the LZO algorithm as the default compression algorithm.
93
94config ZSWAP_COMPRESSOR_DEFAULT_842
95 bool "842"
96 select CRYPTO_842
97 help
98 Use the 842 algorithm as the default compression algorithm.
99
100config ZSWAP_COMPRESSOR_DEFAULT_LZ4
101 bool "LZ4"
102 select CRYPTO_LZ4
103 help
104 Use the LZ4 algorithm as the default compression algorithm.
105
106config ZSWAP_COMPRESSOR_DEFAULT_LZ4HC
107 bool "LZ4HC"
108 select CRYPTO_LZ4HC
109 help
110 Use the LZ4HC algorithm as the default compression algorithm.
111
112config ZSWAP_COMPRESSOR_DEFAULT_ZSTD
113 bool "zstd"
114 select CRYPTO_ZSTD
115 help
116 Use the zstd algorithm as the default compression algorithm.
117endchoice
118
119config ZSWAP_COMPRESSOR_DEFAULT
120 string
121 depends on ZSWAP
122 default "deflate" if ZSWAP_COMPRESSOR_DEFAULT_DEFLATE
123 default "lzo" if ZSWAP_COMPRESSOR_DEFAULT_LZO
124 default "842" if ZSWAP_COMPRESSOR_DEFAULT_842
125 default "lz4" if ZSWAP_COMPRESSOR_DEFAULT_LZ4
126 default "lz4hc" if ZSWAP_COMPRESSOR_DEFAULT_LZ4HC
127 default "zstd" if ZSWAP_COMPRESSOR_DEFAULT_ZSTD
128 default ""
129
130choice
b3fbd58f 131 prompt "Default allocator"
519bcb79 132 depends on ZSWAP
64d4d49c 133 default ZSWAP_ZPOOL_DEFAULT_ZSMALLOC if MMU
519bcb79
JW
134 default ZSWAP_ZPOOL_DEFAULT_ZBUD
135 help
136 Selects the default allocator for the compressed cache for
137 swap pages.
138 The default is 'zbud' for compatibility, however please do
139 read the description of each of the allocators below before
140 making a right choice.
141
142 The selection made here can be overridden by using the kernel
143 command line 'zswap.zpool=' option.
144
145config ZSWAP_ZPOOL_DEFAULT_ZBUD
146 bool "zbud"
147 select ZBUD
148 help
149 Use the zbud allocator as the default allocator.
150
151config ZSWAP_ZPOOL_DEFAULT_Z3FOLD
152 bool "z3fold"
153 select Z3FOLD
154 help
155 Use the z3fold allocator as the default allocator.
156
157config ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
158 bool "zsmalloc"
159 select ZSMALLOC
160 help
161 Use the zsmalloc allocator as the default allocator.
162endchoice
163
164config ZSWAP_ZPOOL_DEFAULT
165 string
166 depends on ZSWAP
167 default "zbud" if ZSWAP_ZPOOL_DEFAULT_ZBUD
168 default "z3fold" if ZSWAP_ZPOOL_DEFAULT_Z3FOLD
169 default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
170 default ""
171
519bcb79 172config ZBUD
b3fbd58f
JW
173 tristate "2:1 compression allocator (zbud)"
174 depends on ZSWAP
519bcb79
JW
175 help
176 A special purpose allocator for storing compressed pages.
177 It is designed to store up to two compressed pages per physical
178 page. While this design limits storage density, it has simple and
179 deterministic reclaim properties that make it preferable to a higher
180 density approach when reclaim will be used.
181
182config Z3FOLD
b3fbd58f
JW
183 tristate "3:1 compression allocator (z3fold)"
184 depends on ZSWAP
519bcb79
JW
185 help
186 A special purpose allocator for storing compressed pages.
187 It is designed to store up to three compressed pages per physical
188 page. It is a ZBUD derivative so the simplicity and determinism are
189 still there.
190
191config ZSMALLOC
b3fbd58f
JW
192 tristate
193 prompt "N:1 compression allocator (zsmalloc)" if ZSWAP
519bcb79
JW
194 depends on MMU
195 help
196 zsmalloc is a slab-based memory allocator designed to store
b3fbd58f
JW
197 pages of various compression levels efficiently. It achieves
198 the highest storage density with the least amount of fragmentation.
519bcb79
JW
199
200config ZSMALLOC_STAT
201 bool "Export zsmalloc statistics"
202 depends on ZSMALLOC
203 select DEBUG_FS
204 help
205 This option enables code in the zsmalloc to collect various
206 statistics about what's happening in zsmalloc and exports that
207 information to userspace via debugfs.
208 If unsure, say N.
209
4ff93b29
SS
210config ZSMALLOC_CHAIN_SIZE
211 int "Maximum number of physical pages per-zspage"
b46402fa 212 default 8
4ff93b29
SS
213 range 4 16
214 depends on ZSMALLOC
215 help
216 This option sets the upper limit on the number of physical pages
217 that a zmalloc page (zspage) can consist of. The optimal zspage
218 chain size is calculated for each size class during the
219 initialization of the pool.
220
221 Changing this option can alter the characteristics of size classes,
222 such as the number of pages per zspage and the number of objects
223 per zspage. This can also result in different configurations of
224 the pool, as zsmalloc merges size classes with similar
225 characteristics.
226
227 For more information, see zsmalloc documentation.
228
2a19be61 229menu "Slab allocator options"
7b42f104
JW
230
231config SLUB
2a19be61 232 def_bool y
eb07c4f3 233
e240e53a 234config SLUB_TINY
2a19be61
VB
235 bool "Configure for minimal memory footprint"
236 depends on EXPERT
e240e53a
VB
237 select SLAB_MERGE_DEFAULT
238 help
2a19be61 239 Configures the slab allocator in a way to achieve minimal memory
e240e53a
VB
240 footprint, sacrificing scalability, debugging and other features.
241 This is intended only for the smallest system that had used the
242 SLOB allocator and is not recommended for systems with more than
243 16MB RAM.
244
245 If unsure, say N.
246
7b42f104
JW
247config SLAB_MERGE_DEFAULT
248 bool "Allow slab caches to be merged"
249 default y
7b42f104
JW
250 help
251 For reduced kernel memory fragmentation, slab caches can be
252 merged when they share the same size and other characteristics.
253 This carries a risk of kernel heap overflows being able to
254 overwrite objects from merged caches (and more easily control
255 cache layout), which makes such heap attacks easier to exploit
256 by attackers. By keeping caches unmerged, these kinds of exploits
257 can usually only damage objects in the same cache. To disable
258 merging at runtime, "slab_nomerge" can be passed on the kernel
259 command line.
260
261config SLAB_FREELIST_RANDOM
262 bool "Randomize slab freelist"
2a19be61 263 depends on !SLUB_TINY
7b42f104
JW
264 help
265 Randomizes the freelist order used on creating new pages. This
266 security feature reduces the predictability of the kernel slab
267 allocator against heap overflows.
268
269config SLAB_FREELIST_HARDENED
270 bool "Harden slab freelist metadata"
2a19be61 271 depends on !SLUB_TINY
7b42f104
JW
272 help
273 Many kernel heap attacks try to target slab cache metadata and
274 other infrastructure. This options makes minor performance
275 sacrifices to harden the kernel slab allocator against common
2a19be61 276 freelist exploit methods.
7b42f104 277
0710d012
VB
278config SLUB_STATS
279 default n
2a19be61
VB
280 bool "Enable performance statistics"
281 depends on SYSFS && !SLUB_TINY
0710d012 282 help
2a19be61 283 The statistics are useful to debug slab allocation behavior in
0710d012
VB
284 order find ways to optimize the allocator. This should never be
285 enabled for production use since keeping statistics slows down
286 the allocator by a few percentage points. The slabinfo command
287 supports the determination of the most active slabs to figure
288 out which slabs are relevant to a particular load.
289 Try running: slabinfo -DA
290
519bcb79
JW
291config SLUB_CPU_PARTIAL
292 default y
2a19be61
VB
293 depends on SMP && !SLUB_TINY
294 bool "Enable per cpu partial caches"
519bcb79
JW
295 help
296 Per cpu partial caches accelerate objects allocation and freeing
297 that is local to a processor at the price of more indeterminism
298 in the latency of the free. On overflow these caches will be cleared
299 which requires the taking of locks that may cause latency spikes.
300 Typically one would choose no for a realtime system.
301
3c615294
GR
302config RANDOM_KMALLOC_CACHES
303 default n
2a19be61 304 depends on !SLUB_TINY
3c615294
GR
305 bool "Randomize slab caches for normal kmalloc"
306 help
307 A hardening feature that creates multiple copies of slab caches for
308 normal kmalloc allocation and makes kmalloc randomly pick one based
309 on code address, which makes the attackers more difficult to spray
310 vulnerable memory objects on the heap for the purpose of exploiting
311 memory vulnerabilities.
312
313 Currently the number of copies is set to 16, a reasonably large value
314 that effectively diverges the memory objects allocated for different
315 subsystems or modules into different caches, at the expense of a
316 limited degree of memory and CPU overhead that relates to hardware and
317 system workload.
318
2a19be61 319endmenu # Slab allocator options
519bcb79 320
7b42f104
JW
321config SHUFFLE_PAGE_ALLOCATOR
322 bool "Page allocator randomization"
323 default SLAB_FREELIST_RANDOM && ACPI_NUMA
324 help
325 Randomization of the page allocator improves the average
326 utilization of a direct-mapped memory-side-cache. See section
327 5.2.27 Heterogeneous Memory Attribute Table (HMAT) in the ACPI
328 6.2a specification for an example of how a platform advertises
329 the presence of a memory-side-cache. There are also incidental
330 security benefits as it reduces the predictability of page
331 allocations to compliment SLAB_FREELIST_RANDOM, but the
23baf831
KS
332 default granularity of shuffling on the MAX_ORDER i.e, 10th
333 order of pages is selected based on cache utilization benefits
334 on x86.
7b42f104
JW
335
336 While the randomization improves cache utilization it may
337 negatively impact workloads on platforms without a cache. For
338 this reason, by default, the randomization is enabled only
339 after runtime detection of a direct-mapped memory-side-cache.
340 Otherwise, the randomization may be force enabled with the
341 'page_alloc.shuffle' kernel command line parameter.
342
343 Say Y if unsure.
344
0710d012
VB
345config COMPAT_BRK
346 bool "Disable heap randomization"
347 default y
348 help
349 Randomizing heap placement makes heap exploits harder, but it
350 also breaks ancient binaries (including anything libc5 based).
351 This option changes the bootup default to heap randomization
352 disabled, and can be overridden at runtime by setting
353 /proc/sys/kernel/randomize_va_space to 2.
354
355 On non-ancient distros (post-2000 ones) N is usually a safe choice.
356
357config MMAP_ALLOW_UNINITIALIZED
358 bool "Allow mmapped anonymous memory to be uninitialized"
359 depends on EXPERT && !MMU
360 default n
361 help
362 Normally, and according to the Linux spec, anonymous memory obtained
363 from mmap() has its contents cleared before it is passed to
364 userspace. Enabling this config option allows you to request that
365 mmap() skip that if it is given an MAP_UNINITIALIZED flag, thus
366 providing a huge performance boost. If this option is not enabled,
367 then the flag will be ignored.
368
369 This is taken advantage of by uClibc's malloc(), and also by
370 ELF-FDPIC binfmt's brk and stack allocator.
371
372 Because of the obvious security issues, this option should only be
373 enabled on embedded devices where you control what is run in
374 userspace. Since that isn't generally a problem on no-MMU systems,
375 it is normally safe to say Y here.
376
377 See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
378
e1785e85
DH
379config SELECT_MEMORY_MODEL
380 def_bool y
a8826eeb 381 depends on ARCH_SELECT_MEMORY_MODEL
e1785e85 382
3a9da765
DH
383choice
384 prompt "Memory model"
e1785e85 385 depends on SELECT_MEMORY_MODEL
d41dee36 386 default SPARSEMEM_MANUAL if ARCH_SPARSEMEM_DEFAULT
e1785e85 387 default FLATMEM_MANUAL
d66d109d
MR
388 help
389 This option allows you to change some of the ways that
390 Linux manages its memory internally. Most users will
391 only have one option here selected by the architecture
392 configuration. This is normal.
3a9da765 393
e1785e85 394config FLATMEM_MANUAL
3a9da765 395 bool "Flat Memory"
bb1c50d3 396 depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE
3a9da765 397 help
d66d109d
MR
398 This option is best suited for non-NUMA systems with
399 flat address space. The FLATMEM is the most efficient
400 system in terms of performance and resource consumption
401 and it is the best option for smaller systems.
402
403 For systems that have holes in their physical address
404 spaces and for features like NUMA and memory hotplug,
dd33d29a 405 choose "Sparse Memory".
d41dee36
AW
406
407 If unsure, choose this option (Flat Memory) over any other.
3a9da765 408
d41dee36
AW
409config SPARSEMEM_MANUAL
410 bool "Sparse Memory"
411 depends on ARCH_SPARSEMEM_ENABLE
412 help
413 This will be the only option for some systems, including
d66d109d 414 memory hot-plug systems. This is normal.
d41dee36 415
d66d109d
MR
416 This option provides efficient support for systems with
417 holes is their physical address space and allows memory
418 hot-plug and hot-remove.
d41dee36 419
d66d109d 420 If unsure, choose "Flat Memory" over this option.
d41dee36 421
3a9da765
DH
422endchoice
423
d41dee36
AW
424config SPARSEMEM
425 def_bool y
1a83e175 426 depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL
d41dee36 427
e1785e85
DH
428config FLATMEM
429 def_bool y
bb1c50d3 430 depends on !SPARSEMEM || FLATMEM_MANUAL
d41dee36 431
3e347261
BP
432#
433# SPARSEMEM_EXTREME (which is the default) does some bootmem
c89ab04f 434# allocations when sparse_init() is called. If this cannot
3e347261
BP
435# be done on your architecture, select this option. However,
436# statically allocating the mem_section[] array can potentially
437# consume vast quantities of .bss, so be careful.
438#
439# This option will also potentially produce smaller runtime code
440# with gcc 3.4 and later.
441#
442config SPARSEMEM_STATIC
9ba16087 443 bool
3e347261 444
802f192e 445#
44c09201 446# Architecture platforms which require a two level mem_section in SPARSEMEM
802f192e
BP
447# must select this option. This is usually for architecture platforms with
448# an extremely sparse physical address space.
449#
3e347261
BP
450config SPARSEMEM_EXTREME
451 def_bool y
452 depends on SPARSEMEM && !SPARSEMEM_STATIC
4c21e2f2 453
29c71111 454config SPARSEMEM_VMEMMAP_ENABLE
9ba16087 455 bool
29c71111
AW
456
457config SPARSEMEM_VMEMMAP
a5ee6daa
GL
458 bool "Sparse Memory virtual memmap"
459 depends on SPARSEMEM && SPARSEMEM_VMEMMAP_ENABLE
460 default y
461 help
19fa40a0
KK
462 SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise
463 pfn_to_page and page_to_pfn operations. This is the most
464 efficient option when sufficient kernel resources are available.
0b376f1e
AK
465#
466# Select this config option from the architecture Kconfig, if it is preferred
467# to enable the feature of HugeTLB/dev_dax vmemmap optimization.
468#
0b6f1582
AK
469config ARCH_WANT_OPTIMIZE_DAX_VMEMMAP
470 bool
471
472config ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
0b376f1e 473 bool
29c71111 474
70210ed9 475config HAVE_MEMBLOCK_PHYS_MAP
6341e62b 476 bool
70210ed9 477
67a929e0 478config HAVE_FAST_GUP
050a9adc 479 depends on MMU
6341e62b 480 bool
2667f50e 481
52219aea
DH
482# Don't discard allocated memory used to track "memory" and "reserved" memblocks
483# after early boot, so it can still be used to test for validity of memory.
484# Also, memblocks are updated with memory hot(un)plug.
350e88ba 485config ARCH_KEEP_MEMBLOCK
6341e62b 486 bool
c378ddd5 487
1e5d8e1e
DW
488# Keep arch NUMA mapping infrastructure post-init.
489config NUMA_KEEP_MEMINFO
490 bool
491
ee6f509c 492config MEMORY_ISOLATION
6341e62b 493 bool
ee6f509c 494
a9e7b8d4
DH
495# IORESOURCE_SYSTEM_RAM regions in the kernel resource tree that are marked
496# IORESOURCE_EXCLUSIVE cannot be mapped to user space, for example, via
497# /dev/mem.
498config EXCLUSIVE_SYSTEM_RAM
499 def_bool y
500 depends on !DEVMEM || STRICT_DEVMEM
501
46723bfa
YI
502#
503# Only be set on architectures that have completely implemented memory hotplug
504# feature. If you are not sure, don't touch it.
505#
506config HAVE_BOOTMEM_INFO_NODE
507 def_bool n
508
91024b3c
AK
509config ARCH_ENABLE_MEMORY_HOTPLUG
510 bool
511
519bcb79
JW
512config ARCH_ENABLE_MEMORY_HOTREMOVE
513 bool
514
3947be19 515# eventually, we can have this option just 'select SPARSEMEM'
519bcb79
JW
516menuconfig MEMORY_HOTPLUG
517 bool "Memory hotplug"
b30c5927 518 select MEMORY_ISOLATION
71b6f2dd 519 depends on SPARSEMEM
40b31360 520 depends on ARCH_ENABLE_MEMORY_HOTPLUG
7ec58a2b 521 depends on 64BIT
1e5d8e1e 522 select NUMA_KEEP_MEMINFO if NUMA
3947be19 523
519bcb79
JW
524if MEMORY_HOTPLUG
525
8604d9e5 526config MEMORY_HOTPLUG_DEFAULT_ONLINE
19fa40a0
KK
527 bool "Online the newly added memory blocks by default"
528 depends on MEMORY_HOTPLUG
529 help
8604d9e5
VK
530 This option sets the default policy setting for memory hotplug
531 onlining policy (/sys/devices/system/memory/auto_online_blocks) which
532 determines what happens to newly added memory regions. Policy setting
533 can always be changed at runtime.
cb1aaebe 534 See Documentation/admin-guide/mm/memory-hotplug.rst for more information.
8604d9e5
VK
535
536 Say Y here if you want all hot-plugged memory blocks to appear in
537 'online' state by default.
538 Say N here if you want the default policy to keep all hot-plugged
539 memory blocks in 'offline' state.
540
0c0e6195
KH
541config MEMORY_HOTREMOVE
542 bool "Allow for memory hot remove"
f7e3334a 543 select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
0c0e6195
KH
544 depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
545 depends on MIGRATION
546
a08a2ae3
OS
547config MHP_MEMMAP_ON_MEMORY
548 def_bool y
549 depends on MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP
550 depends on ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
551
519bcb79
JW
552endif # MEMORY_HOTPLUG
553
04d5ea46
AK
554config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
555 bool
556
4c21e2f2
HD
557# Heavily threaded applications may benefit from splitting the mm-wide
558# page_table_lock, so that faults on different parts of the user address
559# space can be handled with less contention: split it at this NR_CPUS.
560# Default to 4 for wider testing, though 8 might be more appropriate.
561# ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock.
7b6ac9df 562# PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes.
60bccaa6
WD
563# SPARC32 allocates multiple pte tables within a single page, and therefore
564# a per-page lock leads to problems when multiple tables need to be locked
565# at the same time (e.g. copy_page_range()).
a70caa8b 566# DEBUG_SPINLOCK and DEBUG_LOCK_ALLOC spinlock_t also enlarge struct page.
4c21e2f2
HD
567#
568config SPLIT_PTLOCK_CPUS
569 int
9164550e 570 default "999999" if !MMU
a70caa8b
HD
571 default "999999" if ARM && !CPU_CACHE_VIPT
572 default "999999" if PARISC && !PA20
60bccaa6 573 default "999999" if SPARC32
4c21e2f2 574 default "4"
7cbe34cf 575
e009bb30 576config ARCH_ENABLE_SPLIT_PMD_PTLOCK
6341e62b 577 bool
e009bb30 578
09316c09
KK
579#
580# support for memory balloon
581config MEMORY_BALLOON
6341e62b 582 bool
09316c09 583
18468d93
RA
584#
585# support for memory balloon compaction
586config BALLOON_COMPACTION
587 bool "Allow for balloon memory compaction/migration"
588 def_bool y
09316c09 589 depends on COMPACTION && MEMORY_BALLOON
18468d93
RA
590 help
591 Memory fragmentation introduced by ballooning might reduce
592 significantly the number of 2MB contiguous memory blocks that can be
593 used within a guest, thus imposing performance penalties associated
594 with the reduced number of transparent huge pages that could be used
595 by the guest workload. Allowing the compaction & migration for memory
596 pages enlisted as being part of memory balloon devices avoids the
597 scenario aforementioned and helps improving memory defragmentation.
598
e9e96b39
MG
599#
600# support for memory compaction
601config COMPACTION
602 bool "Allow for memory compaction"
05106e6a 603 def_bool y
e9e96b39 604 select MIGRATION
33a93877 605 depends on MMU
e9e96b39 606 help
19fa40a0
KK
607 Compaction is the only memory management component to form
608 high order (larger physically contiguous) memory blocks
609 reliably. The page allocator relies on compaction heavily and
610 the lack of the feature can lead to unexpected OOM killer
611 invocations for high order memory requests. You shouldn't
612 disable this option unless there really is a strong reason for
613 it and then we would be really interested to hear about that at
614 linux-mm@kvack.org.
e9e96b39 615
c7e0b3d0
TG
616config COMPACT_UNEVICTABLE_DEFAULT
617 int
618 depends on COMPACTION
619 default 0 if PREEMPT_RT
620 default 1
621
36e66c55
AD
622#
623# support for free page reporting
624config PAGE_REPORTING
625 bool "Free page reporting"
626 def_bool n
627 help
628 Free page reporting allows for the incremental acquisition of
629 free pages from the buddy allocator for the purpose of reporting
630 those pages to another entity, such as a hypervisor, so that the
631 memory can be freed within the host for other uses.
632
7cbe34cf
CL
633#
634# support for page migration
635#
636config MIGRATION
b20a3503 637 bool "Page migration"
6c5240ae 638 def_bool y
de32a817 639 depends on (NUMA || ARCH_ENABLE_MEMORY_HOTREMOVE || COMPACTION || CMA) && MMU
b20a3503
CL
640 help
641 Allows the migration of the physical location of pages of processes
e9e96b39
MG
642 while the virtual addresses are not changed. This is useful in
643 two situations. The first is on NUMA systems to put pages nearer
644 to the processors accessing. The second is when allocating huge
645 pages as migration can relocate pages to satisfy a huge page
646 allocation instead of reclaiming.
6550e07f 647
76cbbead 648config DEVICE_MIGRATION
d90a25f8 649 def_bool MIGRATION && ZONE_DEVICE
76cbbead 650
c177c81e 651config ARCH_ENABLE_HUGEPAGE_MIGRATION
6341e62b 652 bool
c177c81e 653
9c670ea3
NH
654config ARCH_ENABLE_THP_MIGRATION
655 bool
656
4bfb68a0
AK
657config HUGETLB_PAGE_SIZE_VARIABLE
658 def_bool n
659 help
660 Allows the pageblock_order value to be dynamic instead of just standard
661 HUGETLB_PAGE_ORDER when there are multiple HugeTLB page sizes available
662 on a platform.
663
23baf831
KS
664 Note that the pageblock_order cannot exceed MAX_ORDER and will be
665 clamped down to MAX_ORDER.
b3d40a2b 666
8df995f6 667config CONTIG_ALLOC
19fa40a0 668 def_bool (MEMORY_ISOLATION && COMPACTION) || CMA
8df995f6 669
52166607
HY
670config PCP_BATCH_SCALE_MAX
671 int "Maximum scale factor of PCP (Per-CPU pageset) batch allocate/free"
672 default 5
673 range 0 6
674 help
675 In page allocator, PCP (Per-CPU pageset) is refilled and drained in
676 batches. The batch number is scaled automatically to improve page
677 allocation/free throughput. But too large scale factor may hurt
678 latency. This option sets the upper limit of scale factor to limit
679 the maximum latency.
680
600715dc 681config PHYS_ADDR_T_64BIT
d4a451d5 682 def_bool 64BIT
600715dc 683
2a7326b5 684config BOUNCE
9ca24e2e
VM
685 bool "Enable bounce buffers"
686 default y
ce288e05 687 depends on BLOCK && MMU && HIGHMEM
9ca24e2e 688 help
ce288e05
CH
689 Enable bounce buffers for devices that cannot access the full range of
690 memory available to the CPU. Enabled by default when HIGHMEM is
691 selected, but you may say n to override this.
2a7326b5 692
cddb8a5c
AA
693config MMU_NOTIFIER
694 bool
99cb252f 695 select INTERVAL_TREE
fc4d5c29 696
f8af4da3
HD
697config KSM
698 bool "Enable KSM for page merging"
699 depends on MMU
59e1a2f4 700 select XXHASH
f8af4da3
HD
701 help
702 Enable Kernel Samepage Merging: KSM periodically scans those areas
703 of an application's address space that an app has advised may be
704 mergeable. When it finds pages of identical content, it replaces
d0f209f6 705 the many instances by a single page with that content, so
f8af4da3
HD
706 saving memory until one or another app needs to modify the content.
707 Recommended for use with KVM, or with other duplicative applications.
ee65728e 708 See Documentation/mm/ksm.rst for more information: KSM is inactive
c73602ad
HD
709 until a program has madvised that an area is MADV_MERGEABLE, and
710 root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
f8af4da3 711
e0a94c2a 712config DEFAULT_MMAP_MIN_ADDR
19fa40a0 713 int "Low address space to protect from user allocation"
6e141546 714 depends on MMU
19fa40a0
KK
715 default 4096
716 help
e0a94c2a
CL
717 This is the portion of low virtual memory which should be protected
718 from userspace allocation. Keeping a user from writing to low pages
719 can help reduce the impact of kernel NULL pointer bugs.
720
721 For most ia64, ppc64 and x86 users with lots of address space
722 a value of 65536 is reasonable and should cause no problems.
723 On arm and other archs it should not be higher than 32768.
788084ab
EP
724 Programs which use vm86 functionality or have some need to map
725 this low address space will need CAP_SYS_RAWIO or disable this
726 protection by setting the value to 0.
e0a94c2a
CL
727
728 This value can be changed after boot using the
729 /proc/sys/vm/mmap_min_addr tunable.
730
d949f36f
LT
731config ARCH_SUPPORTS_MEMORY_FAILURE
732 bool
e0a94c2a 733
6a46079c
AK
734config MEMORY_FAILURE
735 depends on MMU
d949f36f 736 depends on ARCH_SUPPORTS_MEMORY_FAILURE
6a46079c 737 bool "Enable recovery from hardware memory errors"
ee6f509c 738 select MEMORY_ISOLATION
97f0b134 739 select RAS
6a46079c
AK
740 help
741 Enables code to recover from some memory failures on systems
742 with MCA recovery. This allows a system to continue running
743 even when some of its memory has uncorrected errors. This requires
744 special hardware support and typically ECC memory.
745
cae681fc 746config HWPOISON_INJECT
413f9efb 747 tristate "HWPoison pages injector"
27df5068 748 depends on MEMORY_FAILURE && DEBUG_KERNEL && PROC_FS
478c5ffc 749 select PROC_PAGE_MONITOR
cae681fc 750
fc4d5c29
DH
751config NOMMU_INITIAL_TRIM_EXCESS
752 int "Turn on mmap() excess space trimming before booting"
753 depends on !MMU
754 default 1
755 help
756 The NOMMU mmap() frequently needs to allocate large contiguous chunks
757 of memory on which to store mappings, but it can only ask the system
758 allocator for chunks in 2^N*PAGE_SIZE amounts - which is frequently
759 more than it requires. To deal with this, mmap() is able to trim off
760 the excess and return it to the allocator.
761
762 If trimming is enabled, the excess is trimmed off and returned to the
763 system allocator, which can cause extra fragmentation, particularly
764 if there are a lot of transient processes.
765
766 If trimming is disabled, the excess is kept, but not used, which for
767 long-term mappings means that the space is wasted.
768
769 Trimming can be dynamically controlled through a sysctl option
770 (/proc/sys/vm/nr_trim_pages) which specifies the minimum number of
771 excess pages there must be before trimming should occur, or zero if
772 no trimming is to occur.
773
774 This option specifies the initial value of this option. The default
775 of 1 says that all excess pages should be trimmed.
776
dd19d293 777 See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
bbddff05 778
519bcb79
JW
779config ARCH_WANT_GENERAL_HUGETLB
780 bool
781
782config ARCH_WANTS_THP_SWAP
783 def_bool n
784
785menuconfig TRANSPARENT_HUGEPAGE
13ece886 786 bool "Transparent Hugepage Support"
554b0f3c 787 depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT
5d689240 788 select COMPACTION
3a08cd52 789 select XARRAY_MULTI
4c76d9d1
AA
790 help
791 Transparent Hugepages allows the kernel to use huge pages and
792 huge tlb transparently to the applications whenever possible.
793 This feature can improve computing performance to certain
794 applications by speeding up page faults during memory
795 allocation, by reducing the number of tlb misses and by speeding
796 up the pagetable walking.
797
798 If memory constrained on embedded, you may want to say N.
799
519bcb79
JW
800if TRANSPARENT_HUGEPAGE
801
13ece886
AA
802choice
803 prompt "Transparent Hugepage Support sysfs defaults"
804 depends on TRANSPARENT_HUGEPAGE
805 default TRANSPARENT_HUGEPAGE_ALWAYS
806 help
807 Selects the sysfs defaults for Transparent Hugepage Support.
808
809 config TRANSPARENT_HUGEPAGE_ALWAYS
810 bool "always"
811 help
812 Enabling Transparent Hugepage always, can increase the
813 memory footprint of applications without a guaranteed
814 benefit but it will work automatically for all applications.
815
816 config TRANSPARENT_HUGEPAGE_MADVISE
817 bool "madvise"
818 help
819 Enabling Transparent Hugepage madvise, will only provide a
820 performance improvement benefit to the applications using
821 madvise(MADV_HUGEPAGE) but it won't risk to increase the
822 memory footprint of applications without a guaranteed
823 benefit.
824endchoice
825
38d8b4e6
HY
826config THP_SWAP
827 def_bool y
dad6a5eb 828 depends on TRANSPARENT_HUGEPAGE && ARCH_WANTS_THP_SWAP && SWAP && 64BIT
38d8b4e6
HY
829 help
830 Swap transparent huge pages in one piece, without splitting.
14fef284
HY
831 XXX: For now, swap cluster backing transparent huge page
832 will be split after swapout.
38d8b4e6
HY
833
834 For selection by architectures with reasonable THP sizes.
835
519bcb79
JW
836config READ_ONLY_THP_FOR_FS
837 bool "Read-only THP for filesystems (EXPERIMENTAL)"
838 depends on TRANSPARENT_HUGEPAGE && SHMEM
839
840 help
841 Allow khugepaged to put read-only file-backed pages in THP.
842
843 This is marked experimental because it is a new feature. Write
844 support of file THPs will be developed in the next few release
845 cycles.
846
847endif # TRANSPARENT_HUGEPAGE
848
bbddff05
TH
849#
850# UP and nommu archs use km based percpu allocator
851#
852config NEED_PER_CPU_KM
3583521a 853 depends on !SMP || !MMU
bbddff05
TH
854 bool
855 default y
077b1f83 856
7ecd19cf
KW
857config NEED_PER_CPU_EMBED_FIRST_CHUNK
858 bool
859
860config NEED_PER_CPU_PAGE_FIRST_CHUNK
861 bool
862
863config USE_PERCPU_NUMA_NODE_ID
864 bool
865
866config HAVE_SETUP_PER_CPU_AREA
867 bool
868
f825c736
AK
869config CMA
870 bool "Contiguous Memory Allocator"
aca52c39 871 depends on MMU
f825c736
AK
872 select MIGRATION
873 select MEMORY_ISOLATION
874 help
875 This enables the Contiguous Memory Allocator which allows other
876 subsystems to allocate big physically-contiguous blocks of memory.
877 CMA reserves a region of memory and allows only movable pages to
878 be allocated from it. This way, the kernel can use the memory for
879 pagecache and when a subsystem requests for contiguous area, the
880 allocated pages are migrated away to serve the contiguous request.
881
882 If unsure, say "n".
883
884config CMA_DEBUG
885 bool "CMA debug messages (DEVELOPMENT)"
886 depends on DEBUG_KERNEL && CMA
887 help
888 Turns on debug messages in CMA. This produces KERN_DEBUG
889 messages for every CMA call as well as various messages while
890 processing calls such as dma_alloc_from_contiguous().
891 This option does not affect warning and error messages.
bf550fc9 892
28b24c1f
SL
893config CMA_DEBUGFS
894 bool "CMA debugfs interface"
895 depends on CMA && DEBUG_FS
896 help
897 Turns on the DebugFS interface for CMA.
898
43ca106f
MK
899config CMA_SYSFS
900 bool "CMA information through sysfs interface"
901 depends on CMA && SYSFS
902 help
903 This option exposes some sysfs attributes to get information
904 from CMA.
905
a254129e
JK
906config CMA_AREAS
907 int "Maximum count of the CMA areas"
908 depends on CMA
b7176c26 909 default 19 if NUMA
a254129e
JK
910 default 7
911 help
912 CMA allows to create CMA areas for particular purpose, mainly,
913 used as device private area. This parameter sets the maximum
914 number of CMA area in the system.
915
b7176c26 916 If unsure, leave the default value "7" in UMA and "19" in NUMA.
a254129e 917
af8d417a
DS
918config MEM_SOFT_DIRTY
919 bool "Track memory changes"
920 depends on CHECKPOINT_RESTORE && HAVE_ARCH_SOFT_DIRTY && PROC_FS
921 select PROC_PAGE_MONITOR
4e2e2770 922 help
af8d417a
DS
923 This option enables memory changes tracking by introducing a
924 soft-dirty bit on pte-s. This bit it set when someone writes
925 into a page just as regular dirty bit, but unlike the latter
926 it can be cleared by hands.
927
1ad1335d 928 See Documentation/admin-guide/mm/soft-dirty.rst for more details.
4e2e2770 929
9e5c33d7
MS
930config GENERIC_EARLY_IOREMAP
931 bool
042d27ac 932
22ee3ea5
HD
933config STACK_MAX_DEFAULT_SIZE_MB
934 int "Default maximum user stack size for 32-bit processes (MB)"
935 default 100
042d27ac
HD
936 range 8 2048
937 depends on STACK_GROWSUP && (!64BIT || COMPAT)
938 help
939 This is the maximum stack size in Megabytes in the VM layout of 32-bit
940 user processes when the stack grows upwards (currently only on parisc
22ee3ea5 941 arch) when the RLIMIT_STACK hard limit is unlimited.
042d27ac 942
22ee3ea5 943 A sane initial value is 100 MB.
3a80a7fa 944
3a80a7fa 945config DEFERRED_STRUCT_PAGE_INIT
1ce22103 946 bool "Defer initialisation of struct pages to kthreads"
d39f8fb4 947 depends on SPARSEMEM
ab1e8d89 948 depends on !NEED_PER_CPU_KM
889c695d 949 depends on 64BIT
e4443149 950 select PADATA
3a80a7fa
MG
951 help
952 Ordinarily all struct pages are initialised during early boot in a
953 single thread. On very large machines this can take a considerable
954 amount of time. If this option is set, large machines will bring up
e4443149
DJ
955 a subset of memmap at boot and then initialise the rest in parallel.
956 This has a potential performance impact on tasks running early in the
1ce22103
VB
957 lifetime of the system until these kthreads finish the
958 initialisation.
033fbae9 959
1c676e0d
SP
960config PAGE_IDLE_FLAG
961 bool
962 select PAGE_EXTENSION if !64BIT
963 help
964 This adds PG_idle and PG_young flags to 'struct page'. PTE Accessed
965 bit writers can set the state of the bit in the flags so that PTE
966 Accessed bit readers may avoid disturbance.
967
33c3fc71
VD
968config IDLE_PAGE_TRACKING
969 bool "Enable idle page tracking"
970 depends on SYSFS && MMU
1c676e0d 971 select PAGE_IDLE_FLAG
33c3fc71
VD
972 help
973 This feature allows to estimate the amount of user pages that have
974 not been touched during a given period of time. This information can
975 be useful to tune memory cgroup limits and/or for job placement
976 within a compute cluster.
977
1ad1335d
MR
978 See Documentation/admin-guide/mm/idle_page_tracking.rst for
979 more details.
33c3fc71 980
c2280be8
AK
981config ARCH_HAS_CACHE_LINE_SIZE
982 bool
983
2792d84e
KC
984config ARCH_HAS_CURRENT_STACK_POINTER
985 bool
986 help
987 In support of HARDENED_USERCOPY performing stack variable lifetime
988 checking, an architecture-agnostic way to find the stack pointer
989 is needed. Once an architecture defines an unsigned long global
990 register alias named "current_stack_pointer", this config can be
991 selected.
992
17596731 993config ARCH_HAS_PTE_DEVMAP
65f7d049
OH
994 bool
995
63703f37
KW
996config ARCH_HAS_ZONE_DMA_SET
997 bool
998
999config ZONE_DMA
1000 bool "Support DMA zone" if ARCH_HAS_ZONE_DMA_SET
1001 default y if ARM64 || X86
1002
1003config ZONE_DMA32
1004 bool "Support DMA32 zone" if ARCH_HAS_ZONE_DMA_SET
1005 depends on !X86_32
1006 default y if ARM64
1007
033fbae9 1008config ZONE_DEVICE
5042db43 1009 bool "Device memory (pmem, HMM, etc...) hotplug support"
033fbae9
DW
1010 depends on MEMORY_HOTPLUG
1011 depends on MEMORY_HOTREMOVE
99490f16 1012 depends on SPARSEMEM_VMEMMAP
17596731 1013 depends on ARCH_HAS_PTE_DEVMAP
3a08cd52 1014 select XARRAY_MULTI
033fbae9
DW
1015
1016 help
1017 Device memory hotplug support allows for establishing pmem,
1018 or other device driver discovered memory regions, in the
1019 memmap. This allows pfn_to_page() lookups of otherwise
1020 "device-physical" addresses which is needed for using a DAX
1021 mapping in an O_DIRECT operation, among other things.
1022
1023 If FS_DAX is enabled, then say Y.
06a660ad 1024
9c240a7b
CH
1025#
1026# Helpers to mirror range of the CPU page tables of a process into device page
1027# tables.
1028#
c0b12405 1029config HMM_MIRROR
9c240a7b 1030 bool
f442c283 1031 depends on MMU
c0b12405 1032
14b80582
DW
1033config GET_FREE_REGION
1034 depends on SPARSEMEM
1035 bool
1036
5042db43
JG
1037config DEVICE_PRIVATE
1038 bool "Unaddressable device memory (GPU memory, ...)"
7328d9cc 1039 depends on ZONE_DEVICE
14b80582 1040 select GET_FREE_REGION
5042db43
JG
1041
1042 help
1043 Allows creation of struct pages to represent unaddressable device
1044 memory; i.e., memory that is only accessible from the device (or
1045 group of devices). You likely also want to select HMM_MIRROR.
1046
3e9a9e25
CH
1047config VMAP_PFN
1048 bool
1049
63c17fb8
DH
1050config ARCH_USES_HIGH_VMA_FLAGS
1051 bool
66d37570
DH
1052config ARCH_HAS_PKEYS
1053 bool
30a5b536 1054
b0284cd2
CM
1055config ARCH_USES_PG_ARCH_X
1056 bool
1057 help
1058 Enable the definition of PG_arch_x page flags with x > 1. Only
1059 suitable for 64-bit architectures with CONFIG_FLATMEM or
1060 CONFIG_SPARSEMEM_VMEMMAP enabled, otherwise there may not be
1061 enough room for additional bits in page->flags.
1062
0710d012
VB
1063config VM_EVENT_COUNTERS
1064 default y
1065 bool "Enable VM event counters for /proc/vmstat" if EXPERT
1066 help
1067 VM event counters are needed for event counts to be shown.
1068 This option allows the disabling of the VM event counters
1069 on EXPERT systems. /proc/vmstat will only show page counts
1070 if VM event counters are disabled.
1071
30a5b536
DZ
1072config PERCPU_STATS
1073 bool "Collect percpu memory statistics"
30a5b536
DZ
1074 help
1075 This feature collects and exposes statistics via debugfs. The
1076 information includes global and per chunk statistics, which can
1077 be used to help understand percpu memory usage.
64c349f4 1078
9c84f229
JH
1079config GUP_TEST
1080 bool "Enable infrastructure for get_user_pages()-related unit tests"
d0de8241 1081 depends on DEBUG_FS
64c349f4 1082 help
9c84f229
JH
1083 Provides /sys/kernel/debug/gup_test, which in turn provides a way
1084 to make ioctl calls that can launch kernel-based unit tests for
1085 the get_user_pages*() and pin_user_pages*() family of API calls.
64c349f4 1086
9c84f229
JH
1087 These tests include benchmark testing of the _fast variants of
1088 get_user_pages*() and pin_user_pages*(), as well as smoke tests of
1089 the non-_fast variants.
1090
f4f9bda4
JH
1091 There is also a sub-test that allows running dump_page() on any
1092 of up to eight pages (selected by command line args) within the
1093 range of user-space addresses. These pages are either pinned via
1094 pin_user_pages*(), or pinned via get_user_pages*(), as specified
1095 by other command line arguments.
1096
baa489fa 1097 See tools/testing/selftests/mm/gup_test.c
3010a5ea 1098
d0de8241
BS
1099comment "GUP_TEST needs to have DEBUG_FS enabled"
1100 depends on !GUP_TEST && !DEBUG_FS
3010a5ea 1101
6ca297d4 1102config GUP_GET_PXX_LOW_HIGH
39656e83
CH
1103 bool
1104
def85743
KB
1105config DMAPOOL_TEST
1106 tristate "Enable a module to run time tests on dma_pool"
1107 depends on HAS_DMA
1108 help
1109 Provides a test module that will allocate and free many blocks of
1110 various sizes and report how long it takes. This is intended to
1111 provide a consistent way to measure how changes to the
1112 dma_pool_alloc/free routines affect performance.
1113
3010a5ea
LD
1114config ARCH_HAS_PTE_SPECIAL
1115 bool
59e0b520 1116
cbd34da7
CH
1117#
1118# Some architectures require a special hugepage directory format that is
1119# required to support multiple hugepage sizes. For example a4fe3ce76
1120# "powerpc/mm: Allow more flexible layouts for hugepage pagetables"
1121# introduced it on powerpc. This allows for a more flexible hugepage
1122# pagetable layouts.
1123#
1124config ARCH_HAS_HUGEPD
1125 bool
1126
c5acad84
TH
1127config MAPPING_DIRTY_HELPERS
1128 bool
1129
298fa1ad
TG
1130config KMAP_LOCAL
1131 bool
1132
825c43f5
AB
1133config KMAP_LOCAL_NON_LINEAR_PTE_ARRAY
1134 bool
1135
1fbaf8fc
CH
1136# struct io_mapping based helper. Selected by drivers that need them
1137config IO_MAPPING
1138 bool
1507f512 1139
626e98cb
TW
1140config MEMFD_CREATE
1141 bool "Enable memfd_create() system call" if EXPERT
1142
1507f512 1143config SECRETMEM
74947724
LB
1144 default y
1145 bool "Enable memfd_secret() system call" if EXPERT
1146 depends on ARCH_HAS_SET_DIRECT_MAP
1147 help
1148 Enable the memfd_secret() system call with the ability to create
1149 memory areas visible only in the context of the owning process and
1150 not mapped to other processes and other kernel page tables.
1507f512 1151
9a10064f
CC
1152config ANON_VMA_NAME
1153 bool "Anonymous VMA name support"
1154 depends on PROC_FS && ADVISE_SYSCALLS && MMU
1155
1156 help
1157 Allow naming anonymous virtual memory areas.
1158
1159 This feature allows assigning names to virtual memory areas. Assigned
1160 names can be later retrieved from /proc/pid/maps and /proc/pid/smaps
1161 and help identifying individual anonymous memory areas.
1162 Assigning a name to anonymous virtual memory area might prevent that
1163 area from being merged with adjacent virtual memory areas due to the
1164 difference in their name.
1165
430529b5
PX
1166config USERFAULTFD
1167 bool "Enable userfaultfd() system call"
1168 depends on MMU
1169 help
1170 Enable the userfaultfd() system call that allows to intercept and
1171 handle page faults in userland.
1172
1173config HAVE_ARCH_USERFAULTFD_WP
1174 bool
1175 help
1176 Arch has userfaultfd write protection support
1177
1178config HAVE_ARCH_USERFAULTFD_MINOR
1179 bool
1180 help
1181 Arch has userfaultfd minor fault support
1182
1db9dbc2 1183config PTE_MARKER_UFFD_WP
81e0f15f
PX
1184 bool "Userfaultfd write protection support for shmem/hugetlbfs"
1185 default y
1186 depends on HAVE_ARCH_USERFAULTFD_WP
1db9dbc2
PX
1187
1188 help
1189 Allows to create marker PTEs for userfaultfd write protection
1190 purposes. It is required to enable userfaultfd write protection on
1191 file-backed memory types like shmem and hugetlbfs.
1192
ac35a490 1193# multi-gen LRU {
ec1c86b2
YZ
1194config LRU_GEN
1195 bool "Multi-Gen LRU"
1196 depends on MMU
1197 # make sure folio->flags has enough spare bits
1198 depends on 64BIT || !SPARSEMEM || SPARSEMEM_VMEMMAP
1199 help
07017acb
YZ
1200 A high performance LRU implementation to overcommit memory. See
1201 Documentation/admin-guide/mm/multigen_lru.rst for details.
ec1c86b2 1202
354ed597
YZ
1203config LRU_GEN_ENABLED
1204 bool "Enable by default"
1205 depends on LRU_GEN
1206 help
1207 This option enables the multi-gen LRU by default.
1208
ac35a490
YZ
1209config LRU_GEN_STATS
1210 bool "Full stats for debugging"
1211 depends on LRU_GEN
1212 help
1213 Do not enable this option unless you plan to look at historical stats
1214 from evicted generations for debugging purpose.
1215
1216 This option has a per-memcg and per-node memory overhead.
1217# }
1218
0b6cc04f
SB
1219config ARCH_SUPPORTS_PER_VMA_LOCK
1220 def_bool n
1221
1222config PER_VMA_LOCK
1223 def_bool y
1224 depends on ARCH_SUPPORTS_PER_VMA_LOCK && MMU && SMP
1225 help
1226 Allow per-vma locking during page fault handling.
1227
1228 This feature allows locking each virtual memory area separately when
1229 handling page faults instead of taking mmap_lock.
1230
c2508ec5
LT
1231config LOCK_MM_AND_FIND_VMA
1232 bool
1233 depends on !STACK_GROWSUP
1234
2224d848
SP
1235source "mm/damon/Kconfig"
1236
59e0b520 1237endmenu