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 12519bcb79SJohannes Weinermenuconfig SWAP 137b42f104SJohannes Weiner bool "Support for paging of anonymous memory (swap)" 147b42f104SJohannes Weiner depends on MMU && BLOCK && !ARCH_NO_SWAP 157b42f104SJohannes Weiner default y 167b42f104SJohannes Weiner help 177b42f104SJohannes Weiner This option allows you to choose whether you want to have support 187b42f104SJohannes Weiner for so called swap devices or swap files in your kernel that are 197b42f104SJohannes Weiner used to provide more virtual memory than the actual RAM present 207b42f104SJohannes Weiner in your computer. If unsure say Y. 217b42f104SJohannes Weiner 22519bcb79SJohannes Weinerconfig ZSWAP 23fcab9b44SDavid Heidelberg bool "Compressed cache for swap pages" 24b3fbd58fSJohannes Weiner depends on SWAP 25b3fbd58fSJohannes Weiner select CRYPTO 262ccd9fecSJohannes Weiner select ZSMALLOC 27519bcb79SJohannes Weiner help 28519bcb79SJohannes Weiner A lightweight compressed cache for swap pages. It takes 29519bcb79SJohannes Weiner pages that are in the process of being swapped out and attempts to 30519bcb79SJohannes Weiner compress them into a dynamically allocated RAM-based memory pool. 31519bcb79SJohannes Weiner This can result in a significant I/O reduction on swap device and, 321a44131dSSophia Gabriella in the case where decompressing from RAM is faster than swap device 33519bcb79SJohannes Weiner reads, can also improve workload performance. 34519bcb79SJohannes Weiner 35b3fbd58fSJohannes Weinerconfig ZSWAP_DEFAULT_ON 36b3fbd58fSJohannes Weiner bool "Enable the compressed cache for swap pages by default" 37b3fbd58fSJohannes Weiner depends on ZSWAP 38b3fbd58fSJohannes Weiner help 39b3fbd58fSJohannes Weiner If selected, the compressed cache for swap pages will be enabled 40b3fbd58fSJohannes Weiner at boot, otherwise it will be disabled. 41b3fbd58fSJohannes Weiner 42b3fbd58fSJohannes Weiner The selection made here can be overridden by using the kernel 43b3fbd58fSJohannes Weiner command line 'zswap.enabled=' option. 44b3fbd58fSJohannes Weiner 45b5ba474fSNhat Phamconfig ZSWAP_SHRINKER_DEFAULT_ON 46b5ba474fSNhat Pham bool "Shrink the zswap pool on memory pressure" 47b5ba474fSNhat Pham depends on ZSWAP 48b5ba474fSNhat Pham default n 49b5ba474fSNhat Pham help 50b5ba474fSNhat Pham If selected, the zswap shrinker will be enabled, and the pages 51b5ba474fSNhat Pham stored in the zswap pool will become available for reclaim (i.e 52b5ba474fSNhat Pham written back to the backing swap device) on memory pressure. 53b5ba474fSNhat Pham 54b5ba474fSNhat Pham This means that zswap writeback could happen even if the pool is 55b5ba474fSNhat Pham not yet full, or the cgroup zswap limit has not been reached, 56b5ba474fSNhat Pham reducing the chance that cold pages will reside in the zswap pool 57b5ba474fSNhat Pham and consume memory indefinitely. 58b5ba474fSNhat Pham 59519bcb79SJohannes Weinerchoice 60b3fbd58fSJohannes Weiner prompt "Default compressor" 61519bcb79SJohannes Weiner depends on ZSWAP 62519bcb79SJohannes Weiner default ZSWAP_COMPRESSOR_DEFAULT_LZO 63519bcb79SJohannes Weiner help 64519bcb79SJohannes Weiner Selects the default compression algorithm for the compressed cache 65519bcb79SJohannes Weiner for swap pages. 66519bcb79SJohannes Weiner 67519bcb79SJohannes Weiner For an overview what kind of performance can be expected from 68519bcb79SJohannes Weiner a particular compression algorithm please refer to the benchmarks 69519bcb79SJohannes Weiner available at the following LWN page: 70519bcb79SJohannes Weiner https://lwn.net/Articles/751795/ 71519bcb79SJohannes Weiner 72519bcb79SJohannes Weiner If in doubt, select 'LZO'. 73519bcb79SJohannes Weiner 74519bcb79SJohannes Weiner The selection made here can be overridden by using the kernel 75519bcb79SJohannes Weiner command line 'zswap.compressor=' option. 76519bcb79SJohannes Weiner 77519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_DEFLATE 78519bcb79SJohannes Weiner bool "Deflate" 79519bcb79SJohannes Weiner select CRYPTO_DEFLATE 80519bcb79SJohannes Weiner help 81519bcb79SJohannes Weiner Use the Deflate algorithm as the default compression algorithm. 82519bcb79SJohannes Weiner 83519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_LZO 84519bcb79SJohannes Weiner bool "LZO" 85519bcb79SJohannes Weiner select CRYPTO_LZO 86519bcb79SJohannes Weiner help 87519bcb79SJohannes Weiner Use the LZO algorithm as the default compression algorithm. 88519bcb79SJohannes Weiner 89519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_842 90519bcb79SJohannes Weiner bool "842" 91519bcb79SJohannes Weiner select CRYPTO_842 92519bcb79SJohannes Weiner help 93519bcb79SJohannes Weiner Use the 842 algorithm as the default compression algorithm. 94519bcb79SJohannes Weiner 95519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_LZ4 96519bcb79SJohannes Weiner bool "LZ4" 97519bcb79SJohannes Weiner select CRYPTO_LZ4 98519bcb79SJohannes Weiner help 99519bcb79SJohannes Weiner Use the LZ4 algorithm as the default compression algorithm. 100519bcb79SJohannes Weiner 101519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_LZ4HC 102519bcb79SJohannes Weiner bool "LZ4HC" 103519bcb79SJohannes Weiner select CRYPTO_LZ4HC 104519bcb79SJohannes Weiner help 105519bcb79SJohannes Weiner Use the LZ4HC algorithm as the default compression algorithm. 106519bcb79SJohannes Weiner 107519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT_ZSTD 108519bcb79SJohannes Weiner bool "zstd" 109519bcb79SJohannes Weiner select CRYPTO_ZSTD 110519bcb79SJohannes Weiner help 111519bcb79SJohannes Weiner Use the zstd algorithm as the default compression algorithm. 112519bcb79SJohannes Weinerendchoice 113519bcb79SJohannes Weiner 114519bcb79SJohannes Weinerconfig ZSWAP_COMPRESSOR_DEFAULT 115519bcb79SJohannes Weiner string 116519bcb79SJohannes Weiner depends on ZSWAP 117519bcb79SJohannes Weiner default "deflate" if ZSWAP_COMPRESSOR_DEFAULT_DEFLATE 118519bcb79SJohannes Weiner default "lzo" if ZSWAP_COMPRESSOR_DEFAULT_LZO 119519bcb79SJohannes Weiner default "842" if ZSWAP_COMPRESSOR_DEFAULT_842 120519bcb79SJohannes Weiner default "lz4" if ZSWAP_COMPRESSOR_DEFAULT_LZ4 121519bcb79SJohannes Weiner default "lz4hc" if ZSWAP_COMPRESSOR_DEFAULT_LZ4HC 122519bcb79SJohannes Weiner default "zstd" if ZSWAP_COMPRESSOR_DEFAULT_ZSTD 123519bcb79SJohannes Weiner default "" 124519bcb79SJohannes Weiner 125519bcb79SJohannes Weinerconfig ZSMALLOC 126b3fbd58fSJohannes Weiner tristate 1272ccd9fecSJohannes Weiner 1282ccd9fecSJohannes Weinerif ZSMALLOC 1292ccd9fecSJohannes Weiner 1302ccd9fecSJohannes Weinermenu "Zsmalloc allocator options" 1312ccd9fecSJohannes Weiner depends on ZSMALLOC 1322ccd9fecSJohannes Weiner 1332ccd9fecSJohannes Weinercomment "Zsmalloc is a common backend allocator for zswap & zram" 134519bcb79SJohannes Weiner 135519bcb79SJohannes Weinerconfig ZSMALLOC_STAT 136519bcb79SJohannes Weiner bool "Export zsmalloc statistics" 137519bcb79SJohannes Weiner select DEBUG_FS 138519bcb79SJohannes Weiner help 139519bcb79SJohannes Weiner This option enables code in the zsmalloc to collect various 140519bcb79SJohannes Weiner statistics about what's happening in zsmalloc and exports that 141519bcb79SJohannes Weiner information to userspace via debugfs. 142519bcb79SJohannes Weiner If unsure, say N. 143519bcb79SJohannes Weiner 1444ff93b29SSergey Senozhatskyconfig ZSMALLOC_CHAIN_SIZE 1454ff93b29SSergey Senozhatsky int "Maximum number of physical pages per-zspage" 146b46402faSSergey Senozhatsky default 8 1474ff93b29SSergey Senozhatsky range 4 16 1484ff93b29SSergey Senozhatsky help 1494ff93b29SSergey Senozhatsky This option sets the upper limit on the number of physical pages 1504ff93b29SSergey Senozhatsky that a zmalloc page (zspage) can consist of. The optimal zspage 1514ff93b29SSergey Senozhatsky chain size is calculated for each size class during the 1524ff93b29SSergey Senozhatsky initialization of the pool. 1534ff93b29SSergey Senozhatsky 1544ff93b29SSergey Senozhatsky Changing this option can alter the characteristics of size classes, 1554ff93b29SSergey Senozhatsky such as the number of pages per zspage and the number of objects 1564ff93b29SSergey Senozhatsky per zspage. This can also result in different configurations of 1574ff93b29SSergey Senozhatsky the pool, as zsmalloc merges size classes with similar 1584ff93b29SSergey Senozhatsky characteristics. 1594ff93b29SSergey Senozhatsky 1604ff93b29SSergey Senozhatsky For more information, see zsmalloc documentation. 1614ff93b29SSergey Senozhatsky 1622ccd9fecSJohannes Weinerendmenu 1632ccd9fecSJohannes Weiner 1642ccd9fecSJohannes Weinerendif 1652ccd9fecSJohannes Weiner 1662a19be61SVlastimil Babkamenu "Slab allocator options" 1677b42f104SJohannes Weiner 1687b42f104SJohannes Weinerconfig SLUB 1692a19be61SVlastimil Babka def_bool y 170af92793eSAlexei Starovoitov select IRQ_WORK 171eb07c4f3SVlastimil Babka 172c9f8f124SVlastimil Babkaconfig KVFREE_RCU_BATCHED 173c9f8f124SVlastimil Babka def_bool y 174c9f8f124SVlastimil Babka depends on !SLUB_TINY && !TINY_RCU 175c9f8f124SVlastimil Babka 176e240e53aSVlastimil Babkaconfig SLUB_TINY 1772a19be61SVlastimil Babka bool "Configure for minimal memory footprint" 1786f110a5eSLinus Torvalds depends on EXPERT && !COMPILE_TEST 179e240e53aSVlastimil Babka select SLAB_MERGE_DEFAULT 180e240e53aSVlastimil Babka help 1812a19be61SVlastimil Babka Configures the slab allocator in a way to achieve minimal memory 182e240e53aSVlastimil Babka footprint, sacrificing scalability, debugging and other features. 183e240e53aSVlastimil Babka This is intended only for the smallest system that had used the 184e240e53aSVlastimil Babka SLOB allocator and is not recommended for systems with more than 185e240e53aSVlastimil Babka 16MB RAM. 186e240e53aSVlastimil Babka 187e240e53aSVlastimil Babka If unsure, say N. 188e240e53aSVlastimil Babka 1897b42f104SJohannes Weinerconfig SLAB_MERGE_DEFAULT 1907b42f104SJohannes Weiner bool "Allow slab caches to be merged" 1917b42f104SJohannes Weiner default y 1927b42f104SJohannes Weiner help 1937b42f104SJohannes Weiner For reduced kernel memory fragmentation, slab caches can be 1947b42f104SJohannes Weiner merged when they share the same size and other characteristics. 1957b42f104SJohannes Weiner This carries a risk of kernel heap overflows being able to 1967b42f104SJohannes Weiner overwrite objects from merged caches (and more easily control 1977b42f104SJohannes Weiner cache layout), which makes such heap attacks easier to exploit 1987b42f104SJohannes Weiner by attackers. By keeping caches unmerged, these kinds of exploits 1997b42f104SJohannes Weiner can usually only damage objects in the same cache. To disable 2007b42f104SJohannes Weiner merging at runtime, "slab_nomerge" can be passed on the kernel 2017b42f104SJohannes Weiner command line. 2027b42f104SJohannes Weiner 2037b42f104SJohannes Weinerconfig SLAB_FREELIST_RANDOM 2047b42f104SJohannes Weiner bool "Randomize slab freelist" 2052a19be61SVlastimil Babka depends on !SLUB_TINY 2067b42f104SJohannes Weiner help 2077b42f104SJohannes Weiner Randomizes the freelist order used on creating new pages. This 2087b42f104SJohannes Weiner security feature reduces the predictability of the kernel slab 2097b42f104SJohannes Weiner allocator against heap overflows. 2107b42f104SJohannes Weiner 2117b42f104SJohannes Weinerconfig SLAB_FREELIST_HARDENED 2127b42f104SJohannes Weiner bool "Harden slab freelist metadata" 2132a19be61SVlastimil Babka depends on !SLUB_TINY 2147b42f104SJohannes Weiner help 2157b42f104SJohannes Weiner Many kernel heap attacks try to target slab cache metadata and 2167b42f104SJohannes Weiner other infrastructure. This options makes minor performance 2177b42f104SJohannes Weiner sacrifices to harden the kernel slab allocator against common 2182a19be61SVlastimil Babka freelist exploit methods. 2197b42f104SJohannes Weiner 22067f2df3bSKees Cookconfig SLAB_BUCKETS 22167f2df3bSKees Cook bool "Support allocation from separate kmalloc buckets" 22267f2df3bSKees Cook depends on !SLUB_TINY 22367f2df3bSKees Cook default SLAB_FREELIST_HARDENED 22467f2df3bSKees Cook help 22567f2df3bSKees Cook Kernel heap attacks frequently depend on being able to create 22667f2df3bSKees Cook specifically-sized allocations with user-controlled contents 22767f2df3bSKees Cook that will be allocated into the same kmalloc bucket as a 22867f2df3bSKees Cook target object. To avoid sharing these allocation buckets, 22967f2df3bSKees Cook provide an explicitly separated set of buckets to be used for 23067f2df3bSKees Cook user-controlled allocations. This may very slightly increase 23167f2df3bSKees Cook memory fragmentation, though in practice it's only a handful 23267f2df3bSKees Cook of extra pages since the bulk of user-controlled allocations 23367f2df3bSKees Cook are relatively long-lived. 23467f2df3bSKees Cook 23567f2df3bSKees Cook If unsure, say Y. 23667f2df3bSKees Cook 2370710d012SVlastimil Babkaconfig SLUB_STATS 2380710d012SVlastimil Babka default n 2392a19be61SVlastimil Babka bool "Enable performance statistics" 2402a19be61SVlastimil Babka depends on SYSFS && !SLUB_TINY 2410710d012SVlastimil Babka help 2422a19be61SVlastimil Babka The statistics are useful to debug slab allocation behavior in 2430710d012SVlastimil Babka order find ways to optimize the allocator. This should never be 2440710d012SVlastimil Babka enabled for production use since keeping statistics slows down 2450710d012SVlastimil Babka the allocator by a few percentage points. The slabinfo command 2460710d012SVlastimil Babka supports the determination of the most active slabs to figure 2470710d012SVlastimil Babka out which slabs are relevant to a particular load. 2480710d012SVlastimil Babka Try running: slabinfo -DA 2490710d012SVlastimil Babka 250519bcb79SJohannes Weinerconfig SLUB_CPU_PARTIAL 251519bcb79SJohannes Weiner default y 2522a19be61SVlastimil Babka depends on SMP && !SLUB_TINY 2532a19be61SVlastimil Babka bool "Enable per cpu partial caches" 254519bcb79SJohannes Weiner help 255519bcb79SJohannes Weiner Per cpu partial caches accelerate objects allocation and freeing 256519bcb79SJohannes Weiner that is local to a processor at the price of more indeterminism 257519bcb79SJohannes Weiner in the latency of the free. On overflow these caches will be cleared 258519bcb79SJohannes Weiner which requires the taking of locks that may cause latency spikes. 259519bcb79SJohannes Weiner Typically one would choose no for a realtime system. 260519bcb79SJohannes Weiner 2613c615294SGONG, Ruiqiconfig RANDOM_KMALLOC_CACHES 2623c615294SGONG, Ruiqi default n 2632a19be61SVlastimil Babka depends on !SLUB_TINY 2643c615294SGONG, Ruiqi bool "Randomize slab caches for normal kmalloc" 2653c615294SGONG, Ruiqi help 2663c615294SGONG, Ruiqi A hardening feature that creates multiple copies of slab caches for 2673c615294SGONG, Ruiqi normal kmalloc allocation and makes kmalloc randomly pick one based 2683c615294SGONG, Ruiqi on code address, which makes the attackers more difficult to spray 2693c615294SGONG, Ruiqi vulnerable memory objects on the heap for the purpose of exploiting 2703c615294SGONG, Ruiqi memory vulnerabilities. 2713c615294SGONG, Ruiqi 2723c615294SGONG, Ruiqi Currently the number of copies is set to 16, a reasonably large value 2733c615294SGONG, Ruiqi that effectively diverges the memory objects allocated for different 2743c615294SGONG, Ruiqi subsystems or modules into different caches, at the expense of a 2753c615294SGONG, Ruiqi limited degree of memory and CPU overhead that relates to hardware and 2763c615294SGONG, Ruiqi system workload. 2773c615294SGONG, Ruiqi 2782a19be61SVlastimil Babkaendmenu # Slab allocator options 279519bcb79SJohannes Weiner 2807b42f104SJohannes Weinerconfig SHUFFLE_PAGE_ALLOCATOR 2817b42f104SJohannes Weiner bool "Page allocator randomization" 2827b42f104SJohannes Weiner default SLAB_FREELIST_RANDOM && ACPI_NUMA 2837b42f104SJohannes Weiner help 2847b42f104SJohannes Weiner Randomization of the page allocator improves the average 2857b42f104SJohannes Weiner utilization of a direct-mapped memory-side-cache. See section 2867b42f104SJohannes Weiner 5.2.27 Heterogeneous Memory Attribute Table (HMAT) in the ACPI 2877b42f104SJohannes Weiner 6.2a specification for an example of how a platform advertises 2887b42f104SJohannes Weiner the presence of a memory-side-cache. There are also incidental 2897b42f104SJohannes Weiner security benefits as it reduces the predictability of page 2907b42f104SJohannes Weiner allocations to compliment SLAB_FREELIST_RANDOM, but the 2915e0a760bSKirill A. Shutemov default granularity of shuffling on the MAX_PAGE_ORDER i.e, 10th 29223baf831SKirill A. Shutemov order of pages is selected based on cache utilization benefits 29323baf831SKirill A. Shutemov on x86. 2947b42f104SJohannes Weiner 2957b42f104SJohannes Weiner While the randomization improves cache utilization it may 2967b42f104SJohannes Weiner negatively impact workloads on platforms without a cache. For 297b413f9cdSMaíra Canal this reason, by default, the randomization is not enabled even 298b413f9cdSMaíra Canal if SHUFFLE_PAGE_ALLOCATOR=y. The randomization may be force enabled 299b413f9cdSMaíra Canal with the 'page_alloc.shuffle' kernel command line parameter. 3007b42f104SJohannes Weiner 3017b42f104SJohannes Weiner Say Y if unsure. 3027b42f104SJohannes Weiner 3030710d012SVlastimil Babkaconfig COMPAT_BRK 3040710d012SVlastimil Babka bool "Disable heap randomization" 3050710d012SVlastimil Babka default y 3060710d012SVlastimil Babka help 3070710d012SVlastimil Babka Randomizing heap placement makes heap exploits harder, but it 3080710d012SVlastimil Babka also breaks ancient binaries (including anything libc5 based). 3090710d012SVlastimil Babka This option changes the bootup default to heap randomization 3100710d012SVlastimil Babka disabled, and can be overridden at runtime by setting 3110710d012SVlastimil Babka /proc/sys/kernel/randomize_va_space to 2. 3120710d012SVlastimil Babka 3130710d012SVlastimil Babka On non-ancient distros (post-2000 ones) N is usually a safe choice. 3140710d012SVlastimil Babka 3150710d012SVlastimil Babkaconfig MMAP_ALLOW_UNINITIALIZED 3160710d012SVlastimil Babka bool "Allow mmapped anonymous memory to be uninitialized" 3170710d012SVlastimil Babka depends on EXPERT && !MMU 3180710d012SVlastimil Babka default n 3190710d012SVlastimil Babka help 3200710d012SVlastimil Babka Normally, and according to the Linux spec, anonymous memory obtained 3210710d012SVlastimil Babka from mmap() has its contents cleared before it is passed to 3220710d012SVlastimil Babka userspace. Enabling this config option allows you to request that 3230710d012SVlastimil Babka mmap() skip that if it is given an MAP_UNINITIALIZED flag, thus 3240710d012SVlastimil Babka providing a huge performance boost. If this option is not enabled, 3250710d012SVlastimil Babka then the flag will be ignored. 3260710d012SVlastimil Babka 3270710d012SVlastimil Babka This is taken advantage of by uClibc's malloc(), and also by 3280710d012SVlastimil Babka ELF-FDPIC binfmt's brk and stack allocator. 3290710d012SVlastimil Babka 3300710d012SVlastimil Babka Because of the obvious security issues, this option should only be 3310710d012SVlastimil Babka enabled on embedded devices where you control what is run in 3320710d012SVlastimil Babka userspace. Since that isn't generally a problem on no-MMU systems, 3330710d012SVlastimil Babka it is normally safe to say Y here. 3340710d012SVlastimil Babka 3350710d012SVlastimil Babka See Documentation/admin-guide/mm/nommu-mmap.rst for more information. 3360710d012SVlastimil Babka 337e1785e85SDave Hansenconfig SELECT_MEMORY_MODEL 338e1785e85SDave Hansen def_bool y 339a8826eebSKees Cook depends on ARCH_SELECT_MEMORY_MODEL 340e1785e85SDave Hansen 3413a9da765SDave Hansenchoice 3423a9da765SDave Hansen prompt "Memory model" 343e1785e85SDave Hansen depends on SELECT_MEMORY_MODEL 344d41dee36SAndy Whitcroft default SPARSEMEM_MANUAL if ARCH_SPARSEMEM_DEFAULT 345e1785e85SDave Hansen default FLATMEM_MANUAL 346d66d109dSMike Rapoport help 347d66d109dSMike Rapoport This option allows you to change some of the ways that 348d66d109dSMike Rapoport Linux manages its memory internally. Most users will 349d66d109dSMike Rapoport only have one option here selected by the architecture 350d66d109dSMike Rapoport configuration. This is normal. 3513a9da765SDave Hansen 352e1785e85SDave Hansenconfig FLATMEM_MANUAL 3533a9da765SDave Hansen bool "Flat Memory" 354bb1c50d3SMike Rapoport depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE 3553a9da765SDave Hansen help 356d66d109dSMike Rapoport This option is best suited for non-NUMA systems with 357d66d109dSMike Rapoport flat address space. The FLATMEM is the most efficient 358d66d109dSMike Rapoport system in terms of performance and resource consumption 359d66d109dSMike Rapoport and it is the best option for smaller systems. 3603a9da765SDave Hansen 361d66d109dSMike Rapoport For systems that have holes in their physical address 362d66d109dSMike Rapoport spaces and for features like NUMA and memory hotplug, 363dd33d29aSRandy Dunlap choose "Sparse Memory". 364d41dee36SAndy Whitcroft 365d41dee36SAndy Whitcroft If unsure, choose this option (Flat Memory) over any other. 3663a9da765SDave Hansen 367d41dee36SAndy Whitcroftconfig SPARSEMEM_MANUAL 368d41dee36SAndy Whitcroft bool "Sparse Memory" 369d41dee36SAndy Whitcroft depends on ARCH_SPARSEMEM_ENABLE 370d41dee36SAndy Whitcroft help 371d41dee36SAndy Whitcroft This will be the only option for some systems, including 372d66d109dSMike Rapoport memory hot-plug systems. This is normal. 373d41dee36SAndy Whitcroft 374d66d109dSMike Rapoport This option provides efficient support for systems with 375d66d109dSMike Rapoport holes is their physical address space and allows memory 376d66d109dSMike Rapoport hot-plug and hot-remove. 377d41dee36SAndy Whitcroft 378d66d109dSMike Rapoport If unsure, choose "Flat Memory" over this option. 379d41dee36SAndy Whitcroft 3803a9da765SDave Hansenendchoice 3813a9da765SDave Hansen 382d41dee36SAndy Whitcroftconfig SPARSEMEM 383d41dee36SAndy Whitcroft def_bool y 3841a83e175SRussell King depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL 385d41dee36SAndy Whitcroft 386e1785e85SDave Hansenconfig FLATMEM 387e1785e85SDave Hansen def_bool y 388bb1c50d3SMike Rapoport depends on !SPARSEMEM || FLATMEM_MANUAL 389d41dee36SAndy Whitcroft 39093b7504eSDave Hansen# 3913e347261SBob Picco# SPARSEMEM_EXTREME (which is the default) does some bootmem 392c89ab04fSMike Rapoport# allocations when sparse_init() is called. If this cannot 3933e347261SBob Picco# be done on your architecture, select this option. However, 3943e347261SBob Picco# statically allocating the mem_section[] array can potentially 3953e347261SBob Picco# consume vast quantities of .bss, so be careful. 3963e347261SBob Picco# 3973e347261SBob Picco# This option will also potentially produce smaller runtime code 3983e347261SBob Picco# with gcc 3.4 and later. 3993e347261SBob Picco# 4003e347261SBob Piccoconfig SPARSEMEM_STATIC 4019ba16087SJan Beulich bool 4023e347261SBob Picco 4033e347261SBob Picco# 40444c09201SMatt LaPlante# Architecture platforms which require a two level mem_section in SPARSEMEM 405802f192eSBob Picco# must select this option. This is usually for architecture platforms with 406802f192eSBob Picco# an extremely sparse physical address space. 407802f192eSBob Picco# 4083e347261SBob Piccoconfig SPARSEMEM_EXTREME 4093e347261SBob Picco def_bool y 4103e347261SBob Picco depends on SPARSEMEM && !SPARSEMEM_STATIC 4114c21e2f2SHugh Dickins 41229c71111SAndy Whitcroftconfig SPARSEMEM_VMEMMAP_ENABLE 4139ba16087SJan Beulich bool 41429c71111SAndy Whitcroft 41529c71111SAndy Whitcroftconfig SPARSEMEM_VMEMMAP 416f8f03eb5SDavid Hildenbrand def_bool y 417a5ee6daaSGeoff Levand depends on SPARSEMEM && SPARSEMEM_VMEMMAP_ENABLE 418a5ee6daaSGeoff Levand help 419a5ee6daaSGeoff Levand SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise 420a5ee6daaSGeoff Levand pfn_to_page and page_to_pfn operations. This is the most 421a5ee6daaSGeoff Levand efficient option when sufficient kernel resources are available. 422d65917c4SFrank van der Linden 423d65917c4SFrank van der Lindenconfig SPARSEMEM_VMEMMAP_PREINIT 424d65917c4SFrank van der Linden bool 4250b376f1eSAneesh Kumar K.V# 4260b376f1eSAneesh Kumar K.V# Select this config option from the architecture Kconfig, if it is preferred 4270b376f1eSAneesh Kumar K.V# to enable the feature of HugeTLB/dev_dax vmemmap optimization. 4280b376f1eSAneesh Kumar K.V# 4290b6f1582SAneesh Kumar K.Vconfig ARCH_WANT_OPTIMIZE_DAX_VMEMMAP 4300b6f1582SAneesh Kumar K.V bool 4310b6f1582SAneesh Kumar K.V 4320b6f1582SAneesh Kumar K.Vconfig ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP 4330b376f1eSAneesh Kumar K.V bool 43429c71111SAndy Whitcroft 435d65917c4SFrank van der Lindenconfig ARCH_WANT_HUGETLB_VMEMMAP_PREINIT 436d65917c4SFrank van der Linden bool 437d65917c4SFrank van der Linden 43870210ed9SPhilipp Hachtmannconfig HAVE_MEMBLOCK_PHYS_MAP 4396341e62bSChristoph Jaeger bool 44070210ed9SPhilipp Hachtmann 44125176ad0SDavid Hildenbrandconfig HAVE_GUP_FAST 442050a9adcSChristoph Hellwig depends on MMU 4436341e62bSChristoph Jaeger bool 4442667f50eSSteve Capper 445d59f43b5SAlexander Graf# Enable memblock support for scratch memory which is needed for kexec handover 446d59f43b5SAlexander Grafconfig MEMBLOCK_KHO_SCRATCH 447d59f43b5SAlexander Graf bool 448d59f43b5SAlexander Graf 44952219aeaSDavid Hildenbrand# Don't discard allocated memory used to track "memory" and "reserved" memblocks 45052219aeaSDavid Hildenbrand# after early boot, so it can still be used to test for validity of memory. 45152219aeaSDavid Hildenbrand# Also, memblocks are updated with memory hot(un)plug. 452350e88baSMike Rapoportconfig ARCH_KEEP_MEMBLOCK 4536341e62bSChristoph Jaeger bool 454c378ddd5STejun Heo 4551e5d8e1eSDan Williams# Keep arch NUMA mapping infrastructure post-init. 4561e5d8e1eSDan Williamsconfig NUMA_KEEP_MEMINFO 4571e5d8e1eSDan Williams bool 4581e5d8e1eSDan Williams 459ee6f509cSMinchan Kimconfig MEMORY_ISOLATION 4606341e62bSChristoph Jaeger bool 461ee6f509cSMinchan Kim 462a9e7b8d4SDavid Hildenbrand# IORESOURCE_SYSTEM_RAM regions in the kernel resource tree that are marked 463a9e7b8d4SDavid Hildenbrand# IORESOURCE_EXCLUSIVE cannot be mapped to user space, for example, via 464a9e7b8d4SDavid Hildenbrand# /dev/mem. 465a9e7b8d4SDavid Hildenbrandconfig EXCLUSIVE_SYSTEM_RAM 466a9e7b8d4SDavid Hildenbrand def_bool y 467a9e7b8d4SDavid Hildenbrand depends on !DEVMEM || STRICT_DEVMEM 468a9e7b8d4SDavid Hildenbrand 46946723bfaSYasuaki Ishimatsu# 47046723bfaSYasuaki Ishimatsu# Only be set on architectures that have completely implemented memory hotplug 47146723bfaSYasuaki Ishimatsu# feature. If you are not sure, don't touch it. 47246723bfaSYasuaki Ishimatsu# 47346723bfaSYasuaki Ishimatsuconfig HAVE_BOOTMEM_INFO_NODE 47446723bfaSYasuaki Ishimatsu def_bool n 47546723bfaSYasuaki Ishimatsu 47691024b3cSAnshuman Khandualconfig ARCH_ENABLE_MEMORY_HOTPLUG 47791024b3cSAnshuman Khandual bool 47891024b3cSAnshuman Khandual 479519bcb79SJohannes Weinerconfig ARCH_ENABLE_MEMORY_HOTREMOVE 480519bcb79SJohannes Weiner bool 481519bcb79SJohannes Weiner 4823947be19SDave Hansen# eventually, we can have this option just 'select SPARSEMEM' 483519bcb79SJohannes Weinermenuconfig MEMORY_HOTPLUG 484519bcb79SJohannes Weiner bool "Memory hotplug" 485b30c5927SDavid Hildenbrand select MEMORY_ISOLATION 48671b6f2ddSDavid Hildenbrand depends on SPARSEMEM 48740b31360SStephen Rothwell depends on ARCH_ENABLE_MEMORY_HOTPLUG 4887ec58a2bSDavid Hildenbrand depends on 64BIT 4891e5d8e1eSDan Williams select NUMA_KEEP_MEMINFO if NUMA 4903947be19SDave Hansen 491519bcb79SJohannes Weinerif MEMORY_HOTPLUG 492519bcb79SJohannes Weiner 49344d46b76SGregory Pricechoice 49444d46b76SGregory Price prompt "Memory Hotplug Default Online Type" 49544d46b76SGregory Price default MHP_DEFAULT_ONLINE_TYPE_OFFLINE 4968604d9e5SVitaly Kuznetsov help 49744d46b76SGregory Price Default memory type for hotplugged memory. 49844d46b76SGregory Price 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. 50344d46b76SGregory Price 50444d46b76SGregory Price The default is 'offline'. 50544d46b76SGregory Price 50644d46b76SGregory Price Select offline to defer onlining to drivers and user policy. 50744d46b76SGregory Price Select auto to let the kernel choose what zones to utilize. 50844d46b76SGregory Price Select online_kernel to generally allow kernel usage of this memory. 50944d46b76SGregory Price Select online_movable to generally disallow kernel usage of this memory. 51044d46b76SGregory Price 51144d46b76SGregory Price Example kernel usage would be page structs and page tables. 51244d46b76SGregory Price 513cb1aaebeSMauro Carvalho Chehab See Documentation/admin-guide/mm/memory-hotplug.rst for more information. 5148604d9e5SVitaly Kuznetsov 51544d46b76SGregory Priceconfig MHP_DEFAULT_ONLINE_TYPE_OFFLINE 51644d46b76SGregory Price bool "offline" 51744d46b76SGregory Price help 51844d46b76SGregory Price Hotplugged memory will not be onlined by default. 51944d46b76SGregory Price Choose this for systems with drivers and user policy that 52044d46b76SGregory Price handle onlining of hotplug memory policy. 52144d46b76SGregory Price 52244d46b76SGregory Priceconfig MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO 52344d46b76SGregory Price bool "auto" 52444d46b76SGregory Price help 52544d46b76SGregory Price Select this if you want the kernel to automatically online 52644d46b76SGregory Price hotplugged memory into the zone it thinks is reasonable. 52744d46b76SGregory Price This memory may be utilized for kernel data. 52844d46b76SGregory Price 52944d46b76SGregory Priceconfig MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL 53044d46b76SGregory Price bool "kernel" 53144d46b76SGregory Price help 53244d46b76SGregory Price Select this if you want the kernel to automatically online 53344d46b76SGregory Price hotplugged memory into a zone capable of being used for kernel 53444d46b76SGregory Price data. This typically means ZONE_NORMAL. 53544d46b76SGregory Price 53644d46b76SGregory Priceconfig MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE 53744d46b76SGregory Price bool "movable" 53844d46b76SGregory Price help 53944d46b76SGregory Price Select this if you want the kernel to automatically online 54044d46b76SGregory Price hotplug memory into ZONE_MOVABLE. This memory will generally 54144d46b76SGregory Price not be utilized for kernel data. 54244d46b76SGregory Price 54344d46b76SGregory Price This should only be used when the admin knows sufficient 54444d46b76SGregory Price ZONE_NORMAL memory is available to describe hotplug memory, 54544d46b76SGregory Price otherwise hotplug memory may fail to online. For example, 54644d46b76SGregory Price sufficient kernel-capable memory (ZONE_NORMAL) must be 54744d46b76SGregory Price available to allocate page structs to describe ZONE_MOVABLE. 54844d46b76SGregory Price 54944d46b76SGregory Priceendchoice 5508604d9e5SVitaly Kuznetsov 5510c0e6195SKAMEZAWA Hiroyukiconfig MEMORY_HOTREMOVE 5520c0e6195SKAMEZAWA Hiroyuki bool "Allow for memory hot remove" 553f7e3334aSNathan Fontenot select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64) 5540c0e6195SKAMEZAWA Hiroyuki depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE 5550c0e6195SKAMEZAWA Hiroyuki depends on MIGRATION 5560c0e6195SKAMEZAWA Hiroyuki 557a08a2ae3SOscar Salvadorconfig MHP_MEMMAP_ON_MEMORY 558a08a2ae3SOscar Salvador def_bool y 559a08a2ae3SOscar Salvador depends on MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP 560a08a2ae3SOscar Salvador depends on ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE 561a08a2ae3SOscar Salvador 562519bcb79SJohannes Weinerendif # MEMORY_HOTPLUG 563519bcb79SJohannes Weiner 56404d5ea46SAneesh Kumar K.Vconfig ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE 56504d5ea46SAneesh Kumar K.V bool 56604d5ea46SAneesh Kumar K.V 5674c21e2f2SHugh Dickins# Heavily threaded applications may benefit from splitting the mm-wide 5684c21e2f2SHugh Dickins# page_table_lock, so that faults on different parts of the user address 5694c21e2f2SHugh Dickins# space can be handled with less contention: split it at this NR_CPUS. 5704c21e2f2SHugh Dickins# Default to 4 for wider testing, though 8 might be more appropriate. 5714c21e2f2SHugh Dickins# ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock. 5727b6ac9dfSHugh Dickins# PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes. 57360bccaa6SWill Deacon# SPARC32 allocates multiple pte tables within a single page, and therefore 57460bccaa6SWill Deacon# a per-page lock leads to problems when multiple tables need to be locked 57560bccaa6SWill Deacon# at the same time (e.g. copy_page_range()). 576a70caa8bSHugh Dickins# DEBUG_SPINLOCK and DEBUG_LOCK_ALLOC spinlock_t also enlarge struct page. 5774c21e2f2SHugh Dickins# 578394290cbSDavid Hildenbrandconfig SPLIT_PTE_PTLOCKS 579394290cbSDavid Hildenbrand def_bool y 580394290cbSDavid Hildenbrand depends on MMU 581a3344078SGuenter Roeck depends on SMP 582394290cbSDavid Hildenbrand depends on NR_CPUS >= 4 583394290cbSDavid Hildenbrand depends on !ARM || CPU_CACHE_VIPT 584394290cbSDavid Hildenbrand depends on !PARISC || PA20 585394290cbSDavid Hildenbrand depends on !SPARC32 5867cbe34cfSChristoph Lameter 587e009bb30SKirill A. Shutemovconfig ARCH_ENABLE_SPLIT_PMD_PTLOCK 5886341e62bSChristoph Jaeger bool 589e009bb30SKirill A. Shutemov 590394290cbSDavid Hildenbrandconfig SPLIT_PMD_PTLOCKS 591394290cbSDavid Hildenbrand def_bool y 592394290cbSDavid Hildenbrand depends on SPLIT_PTE_PTLOCKS && ARCH_ENABLE_SPLIT_PMD_PTLOCK 593394290cbSDavid Hildenbrand 5947cbe34cfSChristoph Lameter# 59509316c09SKonstantin Khlebnikov# support for memory balloon 59609316c09SKonstantin Khlebnikovconfig MEMORY_BALLOON 5976341e62bSChristoph Jaeger bool 59809316c09SKonstantin Khlebnikov 59909316c09SKonstantin Khlebnikov# 60018468d93SRafael Aquini# support for memory balloon compaction 60118468d93SRafael Aquiniconfig BALLOON_COMPACTION 60218468d93SRafael Aquini bool "Allow for balloon memory compaction/migration" 603cd14b018SMasahiro Yamada default y 60409316c09SKonstantin Khlebnikov depends on COMPACTION && MEMORY_BALLOON 60518468d93SRafael Aquini help 60618468d93SRafael Aquini Memory fragmentation introduced by ballooning might reduce 60718468d93SRafael Aquini significantly the number of 2MB contiguous memory blocks that can be 60818468d93SRafael Aquini used within a guest, thus imposing performance penalties associated 60918468d93SRafael Aquini with the reduced number of transparent huge pages that could be used 61018468d93SRafael Aquini by the guest workload. Allowing the compaction & migration for memory 61118468d93SRafael Aquini pages enlisted as being part of memory balloon devices avoids the 61218468d93SRafael Aquini scenario aforementioned and helps improving memory defragmentation. 61318468d93SRafael Aquini 61418468d93SRafael Aquini# 615e9e96b39SMel Gorman# support for memory compaction 616e9e96b39SMel Gormanconfig COMPACTION 617e9e96b39SMel Gorman bool "Allow for memory compaction" 618cd14b018SMasahiro Yamada default y 619e9e96b39SMel Gorman select MIGRATION 62033a93877SAndrea Arcangeli depends on MMU 621e9e96b39SMel Gorman help 622b32eaf71SMichal Hocko Compaction is the only memory management component to form 623b32eaf71SMichal Hocko high order (larger physically contiguous) memory blocks 624b32eaf71SMichal Hocko reliably. The page allocator relies on compaction heavily and 625b32eaf71SMichal Hocko the lack of the feature can lead to unexpected OOM killer 626b32eaf71SMichal Hocko invocations for high order memory requests. You shouldn't 627b32eaf71SMichal Hocko disable this option unless there really is a strong reason for 628b32eaf71SMichal Hocko it and then we would be really interested to hear about that at 629b32eaf71SMichal Hocko linux-mm@kvack.org. 630e9e96b39SMel Gorman 631c7e0b3d0SThomas Gleixnerconfig COMPACT_UNEVICTABLE_DEFAULT 632c7e0b3d0SThomas Gleixner int 633c7e0b3d0SThomas Gleixner depends on COMPACTION 634c7e0b3d0SThomas Gleixner default 0 if PREEMPT_RT 635c7e0b3d0SThomas Gleixner default 1 636c7e0b3d0SThomas Gleixner 637e9e96b39SMel Gorman# 63836e66c55SAlexander Duyck# support for free page reporting 63936e66c55SAlexander Duyckconfig PAGE_REPORTING 64036e66c55SAlexander Duyck bool "Free page reporting" 64136e66c55SAlexander Duyck help 64236e66c55SAlexander Duyck Free page reporting allows for the incremental acquisition of 64336e66c55SAlexander Duyck free pages from the buddy allocator for the purpose of reporting 64436e66c55SAlexander Duyck those pages to another entity, such as a hypervisor, so that the 64536e66c55SAlexander Duyck memory can be freed within the host for other uses. 64636e66c55SAlexander Duyck 64736e66c55SAlexander Duyck# 6487cbe34cfSChristoph Lameter# support for page migration 6497cbe34cfSChristoph Lameter# 6507cbe34cfSChristoph Lameterconfig MIGRATION 651b20a3503SChristoph Lameter bool "Page migration" 652cd14b018SMasahiro Yamada default y 653de32a817SChen Gang depends on (NUMA || ARCH_ENABLE_MEMORY_HOTREMOVE || COMPACTION || CMA) && MMU 654b20a3503SChristoph Lameter help 655b20a3503SChristoph Lameter Allows the migration of the physical location of pages of processes 656e9e96b39SMel Gorman while the virtual addresses are not changed. This is useful in 657e9e96b39SMel Gorman two situations. The first is on NUMA systems to put pages nearer 658e9e96b39SMel Gorman to the processors accessing. The second is when allocating huge 659e9e96b39SMel Gorman pages as migration can relocate pages to satisfy a huge page 660e9e96b39SMel Gorman allocation instead of reclaiming. 6616550e07fSGreg Kroah-Hartman 66276cbbeadSChristoph Hellwigconfig DEVICE_MIGRATION 663d90a25f8SChristoph Hellwig def_bool MIGRATION && ZONE_DEVICE 66476cbbeadSChristoph Hellwig 665c177c81eSNaoya Horiguchiconfig ARCH_ENABLE_HUGEPAGE_MIGRATION 6666341e62bSChristoph Jaeger bool 667c177c81eSNaoya Horiguchi 6689c670ea3SNaoya Horiguchiconfig ARCH_ENABLE_THP_MIGRATION 6699c670ea3SNaoya Horiguchi bool 6709c670ea3SNaoya Horiguchi 6714bfb68a0SAnshuman Khandualconfig HUGETLB_PAGE_SIZE_VARIABLE 6724bfb68a0SAnshuman Khandual def_bool n 6734bfb68a0SAnshuman Khandual help 6744bfb68a0SAnshuman Khandual Allows the pageblock_order value to be dynamic instead of just standard 6754bfb68a0SAnshuman Khandual HUGETLB_PAGE_ORDER when there are multiple HugeTLB page sizes available 6764bfb68a0SAnshuman Khandual on a platform. 6774bfb68a0SAnshuman Khandual 6785e0a760bSKirill A. Shutemov Note that the pageblock_order cannot exceed MAX_PAGE_ORDER and will be 6795e0a760bSKirill A. Shutemov clamped down to MAX_PAGE_ORDER. 680b3d40a2bSDavid Hildenbrand 6818df995f6SAlexandre Ghiticonfig CONTIG_ALLOC 6828df995f6SAlexandre Ghiti def_bool (MEMORY_ISOLATION && COMPACTION) || CMA 6838df995f6SAlexandre Ghiti 68452166607SHuang Yingconfig PCP_BATCH_SCALE_MAX 68552166607SHuang Ying int "Maximum scale factor of PCP (Per-CPU pageset) batch allocate/free" 68652166607SHuang Ying default 5 68752166607SHuang Ying range 0 6 68852166607SHuang Ying help 68952166607SHuang Ying In page allocator, PCP (Per-CPU pageset) is refilled and drained in 69052166607SHuang Ying batches. The batch number is scaled automatically to improve page 69152166607SHuang Ying allocation/free throughput. But too large scale factor may hurt 69252166607SHuang Ying latency. This option sets the upper limit of scale factor to limit 69352166607SHuang Ying the maximum latency. 69452166607SHuang Ying 695600715dcSJeremy Fitzhardingeconfig PHYS_ADDR_T_64BIT 696d4a451d5SChristoph Hellwig def_bool 64BIT 697600715dcSJeremy Fitzhardinge 698cddb8a5cSAndrea Arcangeliconfig MMU_NOTIFIER 699cddb8a5cSAndrea Arcangeli bool 70099cb252fSJason Gunthorpe select INTERVAL_TREE 701fc4d5c29SDavid Howells 702f8af4da3SHugh Dickinsconfig KSM 703f8af4da3SHugh Dickins bool "Enable KSM for page merging" 704f8af4da3SHugh Dickins depends on MMU 70559e1a2f4STimofey Titovets select XXHASH 706f8af4da3SHugh Dickins help 707f8af4da3SHugh Dickins Enable Kernel Samepage Merging: KSM periodically scans those areas 708f8af4da3SHugh Dickins of an application's address space that an app has advised may be 709f8af4da3SHugh Dickins mergeable. When it finds pages of identical content, it replaces 710d0f209f6SHugh Dickins the many instances by a single page with that content, so 711f8af4da3SHugh Dickins saving memory until one or another app needs to modify the content. 712f8af4da3SHugh Dickins Recommended for use with KVM, or with other duplicative applications. 713ee65728eSMike Rapoport See Documentation/mm/ksm.rst for more information: KSM is inactive 714c73602adSHugh Dickins until a program has madvised that an area is MADV_MERGEABLE, and 715c73602adSHugh Dickins root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set). 716f8af4da3SHugh Dickins 717e0a94c2aSChristoph Lameterconfig DEFAULT_MMAP_MIN_ADDR 718e0a94c2aSChristoph Lameter int "Low address space to protect from user allocation" 7196e141546SDavid Howells depends on MMU 720e0a94c2aSChristoph Lameter default 4096 721e0a94c2aSChristoph Lameter help 722e0a94c2aSChristoph Lameter This is the portion of low virtual memory which should be protected 723e0a94c2aSChristoph Lameter from userspace allocation. Keeping a user from writing to low pages 724e0a94c2aSChristoph Lameter can help reduce the impact of kernel NULL pointer bugs. 725e0a94c2aSChristoph Lameter 72634f7c528SJavier Martinez Canillas For most arm64, ppc64 and x86 users with lots of address space 727e0a94c2aSChristoph Lameter a value of 65536 is reasonable and should cause no problems. 728e0a94c2aSChristoph Lameter On arm and other archs it should not be higher than 32768. 729788084abSEric Paris Programs which use vm86 functionality or have some need to map 730788084abSEric Paris this low address space will need CAP_SYS_RAWIO or disable this 731788084abSEric Paris protection by setting the value to 0. 732e0a94c2aSChristoph Lameter 733e0a94c2aSChristoph Lameter This value can be changed after boot using the 734e0a94c2aSChristoph Lameter /proc/sys/vm/mmap_min_addr tunable. 735e0a94c2aSChristoph Lameter 736d949f36fSLinus Torvaldsconfig ARCH_SUPPORTS_MEMORY_FAILURE 737d949f36fSLinus Torvalds bool 738e0a94c2aSChristoph Lameter 7396a46079cSAndi Kleenconfig MEMORY_FAILURE 7406a46079cSAndi Kleen depends on MMU 741d949f36fSLinus Torvalds depends on ARCH_SUPPORTS_MEMORY_FAILURE 7426a46079cSAndi Kleen bool "Enable recovery from hardware memory errors" 7432ec41967SAnkit Agrawal select INTERVAL_TREE 7446a46079cSAndi Kleen help 7456a46079cSAndi Kleen Enables code to recover from some memory failures on systems 7466a46079cSAndi Kleen with MCA recovery. This allows a system to continue running 7476a46079cSAndi Kleen even when some of its memory has uncorrected errors. This requires 7486a46079cSAndi Kleen special hardware support and typically ECC memory. 7496a46079cSAndi Kleen 750cae681fcSAndi Kleenconfig HWPOISON_INJECT 751413f9efbSAndi Kleen tristate "HWPoison pages injector" 75227df5068SAndi Kleen depends on MEMORY_FAILURE && DEBUG_KERNEL && PROC_FS 753478c5ffcSWu Fengguang select PROC_PAGE_MONITOR 754cae681fcSAndi Kleen 755fc4d5c29SDavid Howellsconfig NOMMU_INITIAL_TRIM_EXCESS 756fc4d5c29SDavid Howells int "Turn on mmap() excess space trimming before booting" 757fc4d5c29SDavid Howells depends on !MMU 758fc4d5c29SDavid Howells default 1 759fc4d5c29SDavid Howells help 760fc4d5c29SDavid Howells The NOMMU mmap() frequently needs to allocate large contiguous chunks 761fc4d5c29SDavid Howells of memory on which to store mappings, but it can only ask the system 762fc4d5c29SDavid Howells allocator for chunks in 2^N*PAGE_SIZE amounts - which is frequently 763fc4d5c29SDavid Howells more than it requires. To deal with this, mmap() is able to trim off 764fc4d5c29SDavid Howells the excess and return it to the allocator. 765fc4d5c29SDavid Howells 766fc4d5c29SDavid Howells If trimming is enabled, the excess is trimmed off and returned to the 767fc4d5c29SDavid Howells system allocator, which can cause extra fragmentation, particularly 768fc4d5c29SDavid Howells if there are a lot of transient processes. 769fc4d5c29SDavid Howells 770fc4d5c29SDavid Howells If trimming is disabled, the excess is kept, but not used, which for 771fc4d5c29SDavid Howells long-term mappings means that the space is wasted. 772fc4d5c29SDavid Howells 773fc4d5c29SDavid Howells Trimming can be dynamically controlled through a sysctl option 774fc4d5c29SDavid Howells (/proc/sys/vm/nr_trim_pages) which specifies the minimum number of 775fc4d5c29SDavid Howells excess pages there must be before trimming should occur, or zero if 776fc4d5c29SDavid Howells no trimming is to occur. 777fc4d5c29SDavid Howells 778fc4d5c29SDavid Howells This option specifies the initial value of this option. The default 779fc4d5c29SDavid Howells of 1 says that all excess pages should be trimmed. 780fc4d5c29SDavid Howells 781dd19d293SStephen Kitt See Documentation/admin-guide/mm/nommu-mmap.rst for more information. 782bbddff05STejun Heo 783519bcb79SJohannes Weinerconfig ARCH_WANT_GENERAL_HUGETLB 784519bcb79SJohannes Weiner bool 785519bcb79SJohannes Weiner 786519bcb79SJohannes Weinerconfig ARCH_WANTS_THP_SWAP 787519bcb79SJohannes Weiner def_bool n 788519bcb79SJohannes Weiner 7892d8bd804SPankaj Raghavconfig PERSISTENT_HUGE_ZERO_FOLIO 7902d8bd804SPankaj Raghav bool "Allocate a PMD sized folio for zeroing" 7912d8bd804SPankaj Raghav depends on TRANSPARENT_HUGEPAGE 7922d8bd804SPankaj Raghav help 7932d8bd804SPankaj Raghav Enable this option to reduce the runtime refcounting overhead 7942d8bd804SPankaj Raghav of the huge zero folio and expand the places in the kernel 7952d8bd804SPankaj Raghav that can use huge zero folios. For instance, block I/O benefits 7962d8bd804SPankaj Raghav from access to large folios for zeroing memory. 7972d8bd804SPankaj Raghav 7982d8bd804SPankaj Raghav With this option enabled, the huge zero folio is allocated 7992d8bd804SPankaj Raghav once and never freed. One full huge page's worth of memory shall 8002d8bd804SPankaj Raghav be used. 8012d8bd804SPankaj Raghav 8022d8bd804SPankaj Raghav Say Y if your system has lots of memory. Say N if you are 8032d8bd804SPankaj Raghav memory constrained. 8042d8bd804SPankaj Raghav 8056af8cb80SDavid Hildenbrandconfig MM_ID 8066af8cb80SDavid Hildenbrand def_bool n 8076af8cb80SDavid Hildenbrand 808519bcb79SJohannes Weinermenuconfig TRANSPARENT_HUGEPAGE 80913ece886SAndrea Arcangeli bool "Transparent Hugepage Support" 810554b0f3cSSebastian Andrzej Siewior depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT 8115d689240SAndrea Arcangeli select COMPACTION 8123a08cd52SMatthew Wilcox select XARRAY_MULTI 8136af8cb80SDavid Hildenbrand select MM_ID 8144c76d9d1SAndrea Arcangeli help 8154c76d9d1SAndrea Arcangeli Transparent Hugepages allows the kernel to use huge pages and 8164c76d9d1SAndrea Arcangeli huge tlb transparently to the applications whenever possible. 8174c76d9d1SAndrea Arcangeli This feature can improve computing performance to certain 8184c76d9d1SAndrea Arcangeli applications by speeding up page faults during memory 8194c76d9d1SAndrea Arcangeli allocation, by reducing the number of tlb misses and by speeding 8204c76d9d1SAndrea Arcangeli up the pagetable walking. 8214c76d9d1SAndrea Arcangeli 8224c76d9d1SAndrea Arcangeli If memory constrained on embedded, you may want to say N. 8234c76d9d1SAndrea Arcangeli 824519bcb79SJohannes Weinerif TRANSPARENT_HUGEPAGE 825519bcb79SJohannes Weiner 82613ece886SAndrea Arcangelichoice 82713ece886SAndrea Arcangeli prompt "Transparent Hugepage Support sysfs defaults" 82813ece886SAndrea Arcangeli depends on TRANSPARENT_HUGEPAGE 82913ece886SAndrea Arcangeli default TRANSPARENT_HUGEPAGE_ALWAYS 83013ece886SAndrea Arcangeli help 83113ece886SAndrea Arcangeli Selects the sysfs defaults for Transparent Hugepage Support. 83213ece886SAndrea Arcangeli 83313ece886SAndrea Arcangeli config TRANSPARENT_HUGEPAGE_ALWAYS 83413ece886SAndrea Arcangeli bool "always" 83513ece886SAndrea Arcangeli help 83613ece886SAndrea Arcangeli Enabling Transparent Hugepage always, can increase the 83713ece886SAndrea Arcangeli memory footprint of applications without a guaranteed 83813ece886SAndrea Arcangeli benefit but it will work automatically for all applications. 83913ece886SAndrea Arcangeli 84013ece886SAndrea Arcangeli config TRANSPARENT_HUGEPAGE_MADVISE 84113ece886SAndrea Arcangeli bool "madvise" 84213ece886SAndrea Arcangeli help 84313ece886SAndrea Arcangeli Enabling Transparent Hugepage madvise, will only provide a 84413ece886SAndrea Arcangeli performance improvement benefit to the applications using 84513ece886SAndrea Arcangeli madvise(MADV_HUGEPAGE) but it won't risk to increase the 84613ece886SAndrea Arcangeli memory footprint of applications without a guaranteed 84713ece886SAndrea Arcangeli benefit. 848683ec99fSDmytro Maluka 849683ec99fSDmytro Maluka config TRANSPARENT_HUGEPAGE_NEVER 850683ec99fSDmytro Maluka bool "never" 851683ec99fSDmytro Maluka help 852683ec99fSDmytro Maluka Disable Transparent Hugepage by default. It can still be 853683ec99fSDmytro Maluka enabled at runtime via sysfs. 85413ece886SAndrea Arcangeliendchoice 85513ece886SAndrea Arcangeli 856e97d7c51SDmitry Ilvokhinchoice 857e97d7c51SDmitry Ilvokhin prompt "Shmem hugepage allocation defaults" 858e97d7c51SDmitry Ilvokhin depends on TRANSPARENT_HUGEPAGE 859e97d7c51SDmitry Ilvokhin default TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER 860e97d7c51SDmitry Ilvokhin help 861e97d7c51SDmitry Ilvokhin Selects the hugepage allocation policy defaults for 862e97d7c51SDmitry Ilvokhin the internal shmem mount. 863e97d7c51SDmitry Ilvokhin 864e97d7c51SDmitry Ilvokhin The selection made here can be overridden by using the kernel 865e97d7c51SDmitry Ilvokhin command line 'transparent_hugepage_shmem=' option. 866e97d7c51SDmitry Ilvokhin 867e97d7c51SDmitry Ilvokhin config TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER 868e97d7c51SDmitry Ilvokhin bool "never" 869e97d7c51SDmitry Ilvokhin help 870e97d7c51SDmitry Ilvokhin Disable hugepage allocation for shmem mount by default. It can 871e97d7c51SDmitry Ilvokhin still be enabled with the kernel command line 872e97d7c51SDmitry Ilvokhin 'transparent_hugepage_shmem=' option or at runtime via sysfs 873e97d7c51SDmitry Ilvokhin knob. Note that madvise(MADV_COLLAPSE) can still cause 874e97d7c51SDmitry Ilvokhin transparent huge pages to be obtained even if this mode is 875e97d7c51SDmitry Ilvokhin specified. 876e97d7c51SDmitry Ilvokhin 877e97d7c51SDmitry Ilvokhin config TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ALWAYS 878e97d7c51SDmitry Ilvokhin bool "always" 879e97d7c51SDmitry Ilvokhin help 880e97d7c51SDmitry Ilvokhin Always attempt to allocate hugepage for shmem mount, can 881e97d7c51SDmitry Ilvokhin increase the memory footprint of applications without a 882e97d7c51SDmitry Ilvokhin guaranteed benefit but it will work automatically for all 883e97d7c51SDmitry Ilvokhin applications. 884e97d7c51SDmitry Ilvokhin 885e97d7c51SDmitry Ilvokhin config TRANSPARENT_HUGEPAGE_SHMEM_HUGE_WITHIN_SIZE 886e97d7c51SDmitry Ilvokhin bool "within_size" 887e97d7c51SDmitry Ilvokhin help 888e97d7c51SDmitry Ilvokhin Enable hugepage allocation for shmem mount if the allocation 889e97d7c51SDmitry Ilvokhin will be fully within the i_size. This configuration also takes 890e97d7c51SDmitry Ilvokhin into account any madvise(MADV_HUGEPAGE) hints that may be 891e97d7c51SDmitry Ilvokhin provided by the applications. 892e97d7c51SDmitry Ilvokhin 893e97d7c51SDmitry Ilvokhin config TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ADVISE 894e97d7c51SDmitry Ilvokhin bool "advise" 895e97d7c51SDmitry Ilvokhin help 896e97d7c51SDmitry Ilvokhin Enable hugepage allocation for the shmem mount exclusively when 897e97d7c51SDmitry Ilvokhin applications supply the madvise(MADV_HUGEPAGE) hint. 898e97d7c51SDmitry Ilvokhin This ensures that hugepages are used only in response to explicit 899e97d7c51SDmitry Ilvokhin requests from applications. 900e97d7c51SDmitry Ilvokhinendchoice 901e97d7c51SDmitry Ilvokhin 902e97d7c51SDmitry Ilvokhinchoice 903e97d7c51SDmitry Ilvokhin prompt "Tmpfs hugepage allocation defaults" 904e97d7c51SDmitry Ilvokhin depends on TRANSPARENT_HUGEPAGE 905e97d7c51SDmitry Ilvokhin default TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER 906e97d7c51SDmitry Ilvokhin help 907e97d7c51SDmitry Ilvokhin Selects the hugepage allocation policy defaults for 908e97d7c51SDmitry Ilvokhin the tmpfs mount. 909e97d7c51SDmitry Ilvokhin 910e97d7c51SDmitry Ilvokhin The selection made here can be overridden by using the kernel 911e97d7c51SDmitry Ilvokhin command line 'transparent_hugepage_tmpfs=' option. 912e97d7c51SDmitry Ilvokhin 913e97d7c51SDmitry Ilvokhin config TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER 914e97d7c51SDmitry Ilvokhin bool "never" 915e97d7c51SDmitry Ilvokhin help 916e97d7c51SDmitry Ilvokhin Disable hugepage allocation for tmpfs mount by default. It can 917e97d7c51SDmitry Ilvokhin still be enabled with the kernel command line 918e97d7c51SDmitry Ilvokhin 'transparent_hugepage_tmpfs=' option. Note that 919e97d7c51SDmitry Ilvokhin madvise(MADV_COLLAPSE) can still cause transparent huge pages 920e97d7c51SDmitry Ilvokhin to be obtained even if this mode is specified. 921e97d7c51SDmitry Ilvokhin 922e97d7c51SDmitry Ilvokhin config TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ALWAYS 923e97d7c51SDmitry Ilvokhin bool "always" 924e97d7c51SDmitry Ilvokhin help 925e97d7c51SDmitry Ilvokhin Always attempt to allocate hugepage for tmpfs mount, can 926e97d7c51SDmitry Ilvokhin increase the memory footprint of applications without a 927e97d7c51SDmitry Ilvokhin guaranteed benefit but it will work automatically for all 928e97d7c51SDmitry Ilvokhin applications. 929e97d7c51SDmitry Ilvokhin 930e97d7c51SDmitry Ilvokhin config TRANSPARENT_HUGEPAGE_TMPFS_HUGE_WITHIN_SIZE 931e97d7c51SDmitry Ilvokhin bool "within_size" 932e97d7c51SDmitry Ilvokhin help 933e97d7c51SDmitry Ilvokhin Enable hugepage allocation for tmpfs mount if the allocation 934e97d7c51SDmitry Ilvokhin will be fully within the i_size. This configuration also takes 935e97d7c51SDmitry Ilvokhin into account any madvise(MADV_HUGEPAGE) hints that may be 936e97d7c51SDmitry Ilvokhin provided by the applications. 937e97d7c51SDmitry Ilvokhin 938e97d7c51SDmitry Ilvokhin config TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ADVISE 939e97d7c51SDmitry Ilvokhin bool "advise" 940e97d7c51SDmitry Ilvokhin help 941e97d7c51SDmitry Ilvokhin Enable hugepage allocation for the tmpfs mount exclusively when 942e97d7c51SDmitry Ilvokhin applications supply the madvise(MADV_HUGEPAGE) hint. 943e97d7c51SDmitry Ilvokhin This ensures that hugepages are used only in response to explicit 944e97d7c51SDmitry Ilvokhin requests from applications. 945e97d7c51SDmitry Ilvokhinendchoice 946e97d7c51SDmitry Ilvokhin 94738d8b4e6SHuang Yingconfig THP_SWAP 94838d8b4e6SHuang Ying def_bool y 949dad6a5ebSHugh Dickins depends on TRANSPARENT_HUGEPAGE && ARCH_WANTS_THP_SWAP && SWAP && 64BIT 95038d8b4e6SHuang Ying help 95138d8b4e6SHuang Ying Swap transparent huge pages in one piece, without splitting. 95214fef284SHuang Ying XXX: For now, swap cluster backing transparent huge page 95314fef284SHuang Ying will be split after swapout. 95438d8b4e6SHuang Ying 95538d8b4e6SHuang Ying For selection by architectures with reasonable THP sizes. 95638d8b4e6SHuang Ying 957519bcb79SJohannes Weinerconfig READ_ONLY_THP_FOR_FS 958519bcb79SJohannes Weiner bool "Read-only THP for filesystems (EXPERIMENTAL)" 959cc79061bSBaolin Wang depends on TRANSPARENT_HUGEPAGE 960519bcb79SJohannes Weiner 961519bcb79SJohannes Weiner help 962519bcb79SJohannes Weiner Allow khugepaged to put read-only file-backed pages in THP. 963519bcb79SJohannes Weiner 964519bcb79SJohannes Weiner This is marked experimental because it is a new feature. Write 965519bcb79SJohannes Weiner support of file THPs will be developed in the next few release 966519bcb79SJohannes Weiner cycles. 967519bcb79SJohannes Weiner 968e63ee43eSDavid Hildenbrandconfig NO_PAGE_MAPCOUNT 969e63ee43eSDavid Hildenbrand bool "No per-page mapcount (EXPERIMENTAL)" 970e63ee43eSDavid Hildenbrand help 971e63ee43eSDavid Hildenbrand Do not maintain per-page mapcounts for pages part of larger 972e63ee43eSDavid Hildenbrand allocations, such as transparent huge pages. 973e63ee43eSDavid Hildenbrand 974e63ee43eSDavid Hildenbrand When this config option is enabled, some interfaces that relied on 975e63ee43eSDavid Hildenbrand this information will rely on less-precise per-allocation information 976e63ee43eSDavid Hildenbrand instead: for example, using the average per-page mapcount in such 977e63ee43eSDavid Hildenbrand a large allocation instead of the per-page mapcount. 978e63ee43eSDavid Hildenbrand 979e63ee43eSDavid Hildenbrand EXPERIMENTAL because the impact of some changes is still unclear. 980e63ee43eSDavid Hildenbrand 981519bcb79SJohannes Weinerendif # TRANSPARENT_HUGEPAGE 982519bcb79SJohannes Weiner 983e63ee43eSDavid Hildenbrand# simple helper to make the code a bit easier to read 984e63ee43eSDavid Hildenbrandconfig PAGE_MAPCOUNT 985e63ee43eSDavid Hildenbrand def_bool !NO_PAGE_MAPCOUNT 986e63ee43eSDavid Hildenbrand 987e496cf3dSKirill A. Shutemov# 988ac3830c3SPeter Xu# The architecture supports pgtable leaves that is larger than PAGE_SIZE 989ac3830c3SPeter Xu# 990ac3830c3SPeter Xuconfig PGTABLE_HAS_HUGE_LEAVES 991ac3830c3SPeter Xu def_bool TRANSPARENT_HUGEPAGE || HUGETLB_PAGE 992ac3830c3SPeter Xu 99339231e8dSDavid Hildenbrand (Red Hat)# 99439231e8dSDavid Hildenbrand (Red Hat)# We can end up creating gigantic folio. 99539231e8dSDavid Hildenbrand (Red Hat)# 99639231e8dSDavid Hildenbrand (Red Hat)config HAVE_GIGANTIC_FOLIOS 99739231e8dSDavid Hildenbrand (Red Hat) def_bool (HUGETLB_PAGE && ARCH_HAS_GIGANTIC_PAGE) || \ 99839231e8dSDavid Hildenbrand (Red Hat) (ZONE_DEVICE && HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) 99939231e8dSDavid Hildenbrand (Red Hat) 10005ba2f0a1SDave Hansenconfig ASYNC_KERNEL_PGTABLE_FREE 10015ba2f0a1SDave Hansen def_bool n 10025ba2f0a1SDave Hansen 10036857be5fSPeter Xu# TODO: Allow to be enabled without THP 10046857be5fSPeter Xuconfig ARCH_SUPPORTS_HUGE_PFNMAP 10056857be5fSPeter Xu def_bool n 10066857be5fSPeter Xu depends on TRANSPARENT_HUGEPAGE 10076857be5fSPeter Xu 10086857be5fSPeter Xuconfig ARCH_SUPPORTS_PMD_PFNMAP 10096857be5fSPeter Xu def_bool y 10106857be5fSPeter Xu depends on ARCH_SUPPORTS_HUGE_PFNMAP && HAVE_ARCH_TRANSPARENT_HUGEPAGE 10116857be5fSPeter Xu 10126857be5fSPeter Xuconfig ARCH_SUPPORTS_PUD_PFNMAP 10136857be5fSPeter Xu def_bool y 10146857be5fSPeter Xu depends on ARCH_SUPPORTS_HUGE_PFNMAP && HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD 10156857be5fSPeter Xu 1016ac3830c3SPeter Xu# 101759b5ed40SHao Ge# Architectures that always use weak definitions for percpu 101859b5ed40SHao Ge# variables in modules should set this. 101959b5ed40SHao Ge# 102059b5ed40SHao Geconfig ARCH_MODULE_NEEDS_WEAK_PER_CPU 102159b5ed40SHao Ge bool 102259b5ed40SHao Ge 102359b5ed40SHao Ge# 1024bbddff05STejun Heo# UP and nommu archs use km based percpu allocator 1025bbddff05STejun Heo# 1026bbddff05STejun Heoconfig NEED_PER_CPU_KM 10273583521aSVladimir Murzin depends on !SMP || !MMU 1028bbddff05STejun Heo bool 1029bbddff05STejun Heo default y 1030077b1f83SDan Magenheimer 10317ecd19cfSKefeng Wangconfig NEED_PER_CPU_EMBED_FIRST_CHUNK 10327ecd19cfSKefeng Wang bool 10337ecd19cfSKefeng Wang 10347ecd19cfSKefeng Wangconfig NEED_PER_CPU_PAGE_FIRST_CHUNK 10357ecd19cfSKefeng Wang bool 10367ecd19cfSKefeng Wang 10377ecd19cfSKefeng Wangconfig USE_PERCPU_NUMA_NODE_ID 10387ecd19cfSKefeng Wang bool 10397ecd19cfSKefeng Wang 10407ecd19cfSKefeng Wangconfig HAVE_SETUP_PER_CPU_AREA 10417ecd19cfSKefeng Wang bool 10427ecd19cfSKefeng Wang 1043f825c736SAneesh Kumar K.Vconfig CMA 1044f825c736SAneesh Kumar K.V bool "Contiguous Memory Allocator" 1045aca52c39SMike Rapoport depends on MMU 1046f825c736SAneesh Kumar K.V select MIGRATION 1047f825c736SAneesh Kumar K.V select MEMORY_ISOLATION 1048f825c736SAneesh Kumar K.V help 1049f825c736SAneesh Kumar K.V This enables the Contiguous Memory Allocator which allows other 1050f825c736SAneesh Kumar K.V subsystems to allocate big physically-contiguous blocks of memory. 1051f825c736SAneesh Kumar K.V CMA reserves a region of memory and allows only movable pages to 1052f825c736SAneesh Kumar K.V be allocated from it. This way, the kernel can use the memory for 1053f825c736SAneesh Kumar K.V pagecache and when a subsystem requests for contiguous area, the 1054f825c736SAneesh Kumar K.V allocated pages are migrated away to serve the contiguous request. 1055f825c736SAneesh Kumar K.V 1056f825c736SAneesh Kumar K.V If unsure, say "n". 1057f825c736SAneesh Kumar K.V 105828b24c1fSSasha Levinconfig CMA_DEBUGFS 105928b24c1fSSasha Levin bool "CMA debugfs interface" 106028b24c1fSSasha Levin depends on CMA && DEBUG_FS 106128b24c1fSSasha Levin help 106228b24c1fSSasha Levin Turns on the DebugFS interface for CMA. 106328b24c1fSSasha Levin 106443ca106fSMinchan Kimconfig CMA_SYSFS 106543ca106fSMinchan Kim bool "CMA information through sysfs interface" 106643ca106fSMinchan Kim depends on CMA && SYSFS 106743ca106fSMinchan Kim help 106843ca106fSMinchan Kim This option exposes some sysfs attributes to get information 106943ca106fSMinchan Kim from CMA. 107043ca106fSMinchan Kim 1071a254129eSJoonsoo Kimconfig CMA_AREAS 1072a254129eSJoonsoo Kim int "Maximum count of the CMA areas" 1073a254129eSJoonsoo Kim depends on CMA 107473307523SAnshuman Khandual default 20 if NUMA 107573307523SAnshuman Khandual default 8 1076a254129eSJoonsoo Kim help 1077a254129eSJoonsoo Kim CMA allows to create CMA areas for particular purpose, mainly, 1078a254129eSJoonsoo Kim used as device private area. This parameter sets the maximum 1079a254129eSJoonsoo Kim number of CMA area in the system. 1080a254129eSJoonsoo Kim 108173307523SAnshuman Khandual If unsure, leave the default value "8" in UMA and "20" in NUMA. 1082a254129eSJoonsoo Kim 1083e13e7922SJuan Yescas# 1084e13e7922SJuan Yescas# Select this config option from the architecture Kconfig, if available, to set 1085e13e7922SJuan Yescas# the max page order for physically contiguous allocations. 1086e13e7922SJuan Yescas# 1087e13e7922SJuan Yescasconfig ARCH_FORCE_MAX_ORDER 1088e13e7922SJuan Yescas int 1089e13e7922SJuan Yescas 1090e13e7922SJuan Yescas# 1091e13e7922SJuan Yescas# When ARCH_FORCE_MAX_ORDER is not defined, 1092e13e7922SJuan Yescas# the default page block order is MAX_PAGE_ORDER (10) as per 1093e13e7922SJuan Yescas# include/linux/mmzone.h. 1094e13e7922SJuan Yescas# 10953800d552SZi Yanconfig PAGE_BLOCK_MAX_ORDER 10963800d552SZi Yan int "Page Block Order Upper Limit" 1097e13e7922SJuan Yescas range 1 10 if ARCH_FORCE_MAX_ORDER = 0 1098e13e7922SJuan Yescas default 10 if ARCH_FORCE_MAX_ORDER = 0 1099e13e7922SJuan Yescas range 1 ARCH_FORCE_MAX_ORDER if ARCH_FORCE_MAX_ORDER != 0 1100e13e7922SJuan Yescas default ARCH_FORCE_MAX_ORDER if ARCH_FORCE_MAX_ORDER != 0 1101e13e7922SJuan Yescas help 1102e13e7922SJuan Yescas The page block order refers to the power of two number of pages that 1103e13e7922SJuan Yescas are physically contiguous and can have a migrate type associated to 11043800d552SZi Yan them. The maximum size of the page block order is at least limited by 11053800d552SZi Yan ARCH_FORCE_MAX_ORDER/MAX_PAGE_ORDER. 1106e13e7922SJuan Yescas 11073800d552SZi Yan This config adds a new upper limit of default page block 11083800d552SZi Yan order when the page block order is required to be smaller than 11093800d552SZi Yan ARCH_FORCE_MAX_ORDER/MAX_PAGE_ORDER or other limits 11103800d552SZi Yan (see include/linux/pageblock-flags.h for details). 1111e13e7922SJuan Yescas 1112e13e7922SJuan Yescas Reducing pageblock order can negatively impact THP generation 1113bafa31a1SPaul Menzel success rate. If your workloads use THP heavily, please use this 1114e13e7922SJuan Yescas option with caution. 1115e13e7922SJuan Yescas 1116e13e7922SJuan Yescas Don't change if unsure. 1117e13e7922SJuan Yescas 1118af8d417aSDan Streetmanconfig MEM_SOFT_DIRTY 1119af8d417aSDan Streetman bool "Track memory changes" 1120af8d417aSDan Streetman depends on CHECKPOINT_RESTORE && HAVE_ARCH_SOFT_DIRTY && PROC_FS 1121af8d417aSDan Streetman select PROC_PAGE_MONITOR 11224e2e2770SSeth Jennings help 1123af8d417aSDan Streetman This option enables memory changes tracking by introducing a 1124af8d417aSDan Streetman soft-dirty bit on pte-s. This bit it set when someone writes 1125af8d417aSDan Streetman into a page just as regular dirty bit, but unlike the latter 1126af8d417aSDan Streetman it can be cleared by hands. 1127af8d417aSDan Streetman 11281ad1335dSMike Rapoport See Documentation/admin-guide/mm/soft-dirty.rst for more details. 11294e2e2770SSeth Jennings 11309e5c33d7SMark Salterconfig GENERIC_EARLY_IOREMAP 11319e5c33d7SMark Salter bool 1132042d27acSHelge Deller 113322ee3ea5SHelge Dellerconfig STACK_MAX_DEFAULT_SIZE_MB 113422ee3ea5SHelge Deller int "Default maximum user stack size for 32-bit processes (MB)" 113522ee3ea5SHelge Deller default 100 1136042d27acSHelge Deller range 8 2048 1137042d27acSHelge Deller depends on STACK_GROWSUP && (!64BIT || COMPAT) 1138042d27acSHelge Deller help 1139042d27acSHelge Deller This is the maximum stack size in Megabytes in the VM layout of 32-bit 1140042d27acSHelge Deller user processes when the stack grows upwards (currently only on parisc 114122ee3ea5SHelge Deller arch) when the RLIMIT_STACK hard limit is unlimited. 1142042d27acSHelge Deller 114322ee3ea5SHelge Deller A sane initial value is 100 MB. 11443a80a7faSMel Gorman 11453a80a7faSMel Gormanconfig DEFERRED_STRUCT_PAGE_INIT 11461ce22103SVlastimil Babka bool "Defer initialisation of struct pages to kthreads" 1147d39f8fb4SMike Rapoport depends on SPARSEMEM 1148ab1e8d89SPavel Tatashin depends on !NEED_PER_CPU_KM 1149889c695dSPasha Tatashin depends on 64BIT 1150854fa98dSIlya Leoshkevich depends on !KMSAN 1151e4443149SDaniel Jordan select PADATA 11523a80a7faSMel Gorman help 11533a80a7faSMel Gorman Ordinarily all struct pages are initialised during early boot in a 11543a80a7faSMel Gorman single thread. On very large machines this can take a considerable 11553a80a7faSMel Gorman amount of time. If this option is set, large machines will bring up 1156e4443149SDaniel Jordan a subset of memmap at boot and then initialise the rest in parallel. 1157e4443149SDaniel Jordan This has a potential performance impact on tasks running early in the 11581ce22103SVlastimil Babka lifetime of the system until these kthreads finish the 11591ce22103SVlastimil Babka initialisation. 1160033fbae9SDan Williams 11611c676e0dSSeongJae Parkconfig PAGE_IDLE_FLAG 11621c676e0dSSeongJae Park bool 11631c676e0dSSeongJae Park select PAGE_EXTENSION if !64BIT 11641c676e0dSSeongJae Park help 11651c676e0dSSeongJae Park This adds PG_idle and PG_young flags to 'struct page'. PTE Accessed 11661c676e0dSSeongJae Park bit writers can set the state of the bit in the flags so that PTE 11671c676e0dSSeongJae Park Accessed bit readers may avoid disturbance. 11681c676e0dSSeongJae Park 116933c3fc71SVladimir Davydovconfig IDLE_PAGE_TRACKING 117033c3fc71SVladimir Davydov bool "Enable idle page tracking" 117133c3fc71SVladimir Davydov depends on SYSFS && MMU 11721c676e0dSSeongJae Park select PAGE_IDLE_FLAG 117333c3fc71SVladimir Davydov help 117433c3fc71SVladimir Davydov This feature allows to estimate the amount of user pages that have 117533c3fc71SVladimir Davydov not been touched during a given period of time. This information can 117633c3fc71SVladimir Davydov be useful to tune memory cgroup limits and/or for job placement 117733c3fc71SVladimir Davydov within a compute cluster. 117833c3fc71SVladimir Davydov 11791ad1335dSMike Rapoport See Documentation/admin-guide/mm/idle_page_tracking.rst for 11801ad1335dSMike Rapoport more details. 118133c3fc71SVladimir Davydov 11828690bbcfSMathieu Desnoyers# Architectures which implement cpu_dcache_is_aliasing() to query 11838690bbcfSMathieu Desnoyers# whether the data caches are aliased (VIVT or VIPT with dcache 11848690bbcfSMathieu Desnoyers# aliasing) need to select this. 11858690bbcfSMathieu Desnoyersconfig ARCH_HAS_CPU_CACHE_ALIASING 11868690bbcfSMathieu Desnoyers bool 11878690bbcfSMathieu Desnoyers 1188c2280be8SAnshuman Khandualconfig ARCH_HAS_CACHE_LINE_SIZE 1189c2280be8SAnshuman Khandual bool 1190c2280be8SAnshuman Khandual 11912792d84eSKees Cookconfig ARCH_HAS_CURRENT_STACK_POINTER 11922792d84eSKees Cook bool 11932792d84eSKees Cook help 11942792d84eSKees Cook In support of HARDENED_USERCOPY performing stack variable lifetime 11952792d84eSKees Cook checking, an architecture-agnostic way to find the stack pointer 11962792d84eSKees Cook is needed. Once an architecture defines an unsigned long global 11972792d84eSKees Cook register alias named "current_stack_pointer", this config can be 11982792d84eSKees Cook selected. 11992792d84eSKees Cook 120063703f37SKefeng Wangconfig ARCH_HAS_ZONE_DMA_SET 120163703f37SKefeng Wang bool 120263703f37SKefeng Wang 120363703f37SKefeng Wangconfig ZONE_DMA 120463703f37SKefeng Wang bool "Support DMA zone" if ARCH_HAS_ZONE_DMA_SET 120563703f37SKefeng Wang default y if ARM64 || X86 120663703f37SKefeng Wang 120763703f37SKefeng Wangconfig ZONE_DMA32 120863703f37SKefeng Wang bool "Support DMA32 zone" if ARCH_HAS_ZONE_DMA_SET 120963703f37SKefeng Wang depends on !X86_32 121063703f37SKefeng Wang default y if ARM64 121163703f37SKefeng Wang 1212033fbae9SDan Williamsconfig ZONE_DEVICE 12135042db43SJérôme Glisse bool "Device memory (pmem, HMM, etc...) hotplug support" 1214033fbae9SDan Williams depends on MEMORY_HOTPLUG 1215033fbae9SDan Williams depends on MEMORY_HOTREMOVE 121699490f16SDan Williams depends on SPARSEMEM_VMEMMAP 12173a08cd52SMatthew Wilcox select XARRAY_MULTI 1218033fbae9SDan Williams 1219033fbae9SDan Williams help 1220033fbae9SDan Williams Device memory hotplug support allows for establishing pmem, 1221033fbae9SDan Williams or other device driver discovered memory regions, in the 1222033fbae9SDan Williams memmap. This allows pfn_to_page() lookups of otherwise 1223*269031b1SDan Williams "device-physical" addresses which is needed for DAX, PCI_P2PDMA, and 1224*269031b1SDan Williams DEVICE_PRIVATE features among others. 1225033fbae9SDan Williams 1226*269031b1SDan Williams Enabling this option will reduce the entropy of x86 KASLR memory 1227*269031b1SDan Williams regions. For example - on a 46 bit system, the entropy goes down 1228*269031b1SDan Williams from 16 bits to 15 bits. The actual reduction in entropy depends 1229*269031b1SDan Williams on the physical address bits, on processor features, kernel config 1230*269031b1SDan Williams (5 level page table) and physical memory present on the system. 123106a660adSLinus Torvalds 12329c240a7bSChristoph Hellwig# 12339c240a7bSChristoph Hellwig# Helpers to mirror range of the CPU page tables of a process into device page 12349c240a7bSChristoph Hellwig# tables. 12359c240a7bSChristoph Hellwig# 1236c0b12405SJérôme Glisseconfig HMM_MIRROR 12379c240a7bSChristoph Hellwig bool 1238f442c283SChristoph Hellwig depends on MMU 1239c0b12405SJérôme Glisse 124014b80582SDan Williamsconfig GET_FREE_REGION 124114b80582SDan Williams bool 124214b80582SDan Williams 12435042db43SJérôme Glisseconfig DEVICE_PRIVATE 12445042db43SJérôme Glisse bool "Unaddressable device memory (GPU memory, ...)" 12457328d9ccSChristoph Hellwig depends on ZONE_DEVICE 124614b80582SDan Williams select GET_FREE_REGION 12475042db43SJérôme Glisse 12485042db43SJérôme Glisse help 12495042db43SJérôme Glisse Allows creation of struct pages to represent unaddressable device 12505042db43SJérôme Glisse memory; i.e., memory that is only accessible from the device (or 12515042db43SJérôme Glisse group of devices). You likely also want to select HMM_MIRROR. 12525042db43SJérôme Glisse 12533e9a9e25SChristoph Hellwigconfig VMAP_PFN 12543e9a9e25SChristoph Hellwig bool 12553e9a9e25SChristoph Hellwig 125663c17fb8SDave Hansenconfig ARCH_USES_HIGH_VMA_FLAGS 125763c17fb8SDave Hansen bool 125866d37570SDave Hansenconfig ARCH_HAS_PKEYS 125966d37570SDave Hansen bool 126030a5b536SDennis Zhou 12617a87225aSMatthew Wilcox (Oracle)config ARCH_USES_PG_ARCH_2 1262b0284cd2SCatalin Marinas bool 12637a87225aSMatthew Wilcox (Oracle)config ARCH_USES_PG_ARCH_3 12647a87225aSMatthew Wilcox (Oracle) bool 1265b0284cd2SCatalin Marinas 12660710d012SVlastimil Babkaconfig VM_EVENT_COUNTERS 12670710d012SVlastimil Babka default y 12680710d012SVlastimil Babka bool "Enable VM event counters for /proc/vmstat" if EXPERT 12690710d012SVlastimil Babka help 12700710d012SVlastimil Babka VM event counters are needed for event counts to be shown. 12710710d012SVlastimil Babka This option allows the disabling of the VM event counters 12720710d012SVlastimil Babka on EXPERT systems. /proc/vmstat will only show page counts 12730710d012SVlastimil Babka if VM event counters are disabled. 12740710d012SVlastimil Babka 127530a5b536SDennis Zhouconfig PERCPU_STATS 127630a5b536SDennis Zhou bool "Collect percpu memory statistics" 127730a5b536SDennis Zhou help 127830a5b536SDennis Zhou This feature collects and exposes statistics via debugfs. The 127930a5b536SDennis Zhou information includes global and per chunk statistics, which can 128030a5b536SDennis Zhou be used to help understand percpu memory usage. 128164c349f4SKirill A. Shutemov 12829c84f229SJohn Hubbardconfig GUP_TEST 12839c84f229SJohn Hubbard bool "Enable infrastructure for get_user_pages()-related unit tests" 1284d0de8241SBarry Song depends on DEBUG_FS 128564c349f4SKirill A. Shutemov help 12869c84f229SJohn Hubbard Provides /sys/kernel/debug/gup_test, which in turn provides a way 12879c84f229SJohn Hubbard to make ioctl calls that can launch kernel-based unit tests for 12889c84f229SJohn Hubbard the get_user_pages*() and pin_user_pages*() family of API calls. 128964c349f4SKirill A. Shutemov 12909c84f229SJohn Hubbard These tests include benchmark testing of the _fast variants of 12919c84f229SJohn Hubbard get_user_pages*() and pin_user_pages*(), as well as smoke tests of 12929c84f229SJohn Hubbard the non-_fast variants. 12939c84f229SJohn Hubbard 1294f4f9bda4SJohn Hubbard There is also a sub-test that allows running dump_page() on any 1295f4f9bda4SJohn Hubbard of up to eight pages (selected by command line args) within the 1296f4f9bda4SJohn Hubbard range of user-space addresses. These pages are either pinned via 1297f4f9bda4SJohn Hubbard pin_user_pages*(), or pinned via get_user_pages*(), as specified 1298f4f9bda4SJohn Hubbard by other command line arguments. 1299f4f9bda4SJohn Hubbard 1300baa489faSSeongJae Park See tools/testing/selftests/mm/gup_test.c 13013010a5eaSLaurent Dufour 1302d0de8241SBarry Songcomment "GUP_TEST needs to have DEBUG_FS enabled" 1303d0de8241SBarry Song depends on !GUP_TEST && !DEBUG_FS 13043010a5eaSLaurent Dufour 13056ca297d4SPeter Zijlstraconfig GUP_GET_PXX_LOW_HIGH 130639656e83SChristoph Hellwig bool 130739656e83SChristoph Hellwig 1308def85743SKeith Buschconfig DMAPOOL_TEST 1309def85743SKeith Busch tristate "Enable a module to run time tests on dma_pool" 1310def85743SKeith Busch depends on HAS_DMA 1311def85743SKeith Busch help 1312def85743SKeith Busch Provides a test module that will allocate and free many blocks of 1313def85743SKeith Busch various sizes and report how long it takes. This is intended to 1314def85743SKeith Busch provide a consistent way to measure how changes to the 1315def85743SKeith Busch dma_pool_alloc/free routines affect performance. 1316def85743SKeith Busch 13173010a5eaSLaurent Dufourconfig ARCH_HAS_PTE_SPECIAL 13183010a5eaSLaurent Dufour bool 131959e0b520SChristoph Hellwig 1320c5acad84SThomas Hellstromconfig MAPPING_DIRTY_HELPERS 1321c5acad84SThomas Hellstrom bool 1322c5acad84SThomas Hellstrom 1323298fa1adSThomas Gleixnerconfig KMAP_LOCAL 1324298fa1adSThomas Gleixner bool 1325298fa1adSThomas Gleixner 1326825c43f5SArd Biesheuvelconfig KMAP_LOCAL_NON_LINEAR_PTE_ARRAY 1327825c43f5SArd Biesheuvel bool 1328825c43f5SArd Biesheuvel 1329626e98cbSThomas Weißschuhconfig MEMFD_CREATE 1330626e98cbSThomas Weißschuh bool "Enable memfd_create() system call" if EXPERT 1331626e98cbSThomas Weißschuh 13321507f512SMike Rapoportconfig SECRETMEM 133374947724SLukas Bulwahn default y 133474947724SLukas Bulwahn bool "Enable memfd_secret() system call" if EXPERT 133574947724SLukas Bulwahn depends on ARCH_HAS_SET_DIRECT_MAP 133674947724SLukas Bulwahn help 133774947724SLukas Bulwahn Enable the memfd_secret() system call with the ability to create 133874947724SLukas Bulwahn memory areas visible only in the context of the owning process and 133974947724SLukas Bulwahn not mapped to other processes and other kernel page tables. 13401507f512SMike Rapoport 13419a10064fSColin Crossconfig ANON_VMA_NAME 13429a10064fSColin Cross bool "Anonymous VMA name support" 13439a10064fSColin Cross depends on PROC_FS && ADVISE_SYSCALLS && MMU 13449a10064fSColin Cross 13459a10064fSColin Cross help 13469a10064fSColin Cross Allow naming anonymous virtual memory areas. 13479a10064fSColin Cross 13489a10064fSColin Cross This feature allows assigning names to virtual memory areas. Assigned 13499a10064fSColin Cross names can be later retrieved from /proc/pid/maps and /proc/pid/smaps 13509a10064fSColin Cross and help identifying individual anonymous memory areas. 13519a10064fSColin Cross Assigning a name to anonymous virtual memory area might prevent that 13529a10064fSColin Cross area from being merged with adjacent virtual memory areas due to the 13539a10064fSColin Cross difference in their name. 13549a10064fSColin Cross 1355430529b5SPeter Xuconfig HAVE_ARCH_USERFAULTFD_WP 1356430529b5SPeter Xu bool 1357430529b5SPeter Xu help 1358430529b5SPeter Xu Arch has userfaultfd write protection support 1359430529b5SPeter Xu 1360430529b5SPeter Xuconfig HAVE_ARCH_USERFAULTFD_MINOR 1361430529b5SPeter Xu bool 1362430529b5SPeter Xu help 1363430529b5SPeter Xu Arch has userfaultfd minor fault support 1364430529b5SPeter Xu 136597219cc3SPeter Xumenuconfig USERFAULTFD 136697219cc3SPeter Xu bool "Enable userfaultfd() system call" 136797219cc3SPeter Xu depends on MMU 136897219cc3SPeter Xu help 136997219cc3SPeter Xu Enable the userfaultfd() system call that allows to intercept and 137097219cc3SPeter Xu handle page faults in userland. 137197219cc3SPeter Xu 137297219cc3SPeter Xuif USERFAULTFD 13731db9dbc2SPeter Xuconfig PTE_MARKER_UFFD_WP 137481e0f15fSPeter Xu bool "Userfaultfd write protection support for shmem/hugetlbfs" 137581e0f15fSPeter Xu default y 137681e0f15fSPeter Xu depends on HAVE_ARCH_USERFAULTFD_WP 13771db9dbc2SPeter Xu 13781db9dbc2SPeter Xu help 13791db9dbc2SPeter Xu Allows to create marker PTEs for userfaultfd write protection 13801db9dbc2SPeter Xu purposes. It is required to enable userfaultfd write protection on 13811db9dbc2SPeter Xu file-backed memory types like shmem and hugetlbfs. 138297219cc3SPeter Xuendif # USERFAULTFD 13831db9dbc2SPeter Xu 1384ac35a490SYu Zhao# multi-gen LRU { 1385ec1c86b2SYu Zhaoconfig LRU_GEN 1386ec1c86b2SYu Zhao bool "Multi-Gen LRU" 1387ec1c86b2SYu Zhao depends on MMU 1388ec1c86b2SYu Zhao # make sure folio->flags has enough spare bits 1389ec1c86b2SYu Zhao depends on 64BIT || !SPARSEMEM || SPARSEMEM_VMEMMAP 1390ec1c86b2SYu Zhao help 139107017acbSYu Zhao A high performance LRU implementation to overcommit memory. See 139207017acbSYu Zhao Documentation/admin-guide/mm/multigen_lru.rst for details. 1393ec1c86b2SYu Zhao 1394354ed597SYu Zhaoconfig LRU_GEN_ENABLED 1395354ed597SYu Zhao bool "Enable by default" 1396354ed597SYu Zhao depends on LRU_GEN 1397354ed597SYu Zhao help 1398354ed597SYu Zhao This option enables the multi-gen LRU by default. 1399354ed597SYu Zhao 1400ac35a490SYu Zhaoconfig LRU_GEN_STATS 1401ac35a490SYu Zhao bool "Full stats for debugging" 1402ac35a490SYu Zhao depends on LRU_GEN 1403ac35a490SYu Zhao help 1404ac35a490SYu Zhao Do not enable this option unless you plan to look at historical stats 1405ac35a490SYu Zhao from evicted generations for debugging purpose. 1406ac35a490SYu Zhao 1407ac35a490SYu Zhao This option has a per-memcg and per-node memory overhead. 140861dd3f24SKinsey Ho 140961dd3f24SKinsey Hoconfig LRU_GEN_WALKS_MMU 141061dd3f24SKinsey Ho def_bool y 141161dd3f24SKinsey Ho depends on LRU_GEN && ARCH_HAS_HW_PTE_YOUNG 1412ac35a490SYu Zhao# } 1413ac35a490SYu Zhao 14140b6cc04fSSuren Baghdasaryanconfig ARCH_SUPPORTS_PER_VMA_LOCK 14150b6cc04fSSuren Baghdasaryan def_bool n 14160b6cc04fSSuren Baghdasaryan 14170b6cc04fSSuren Baghdasaryanconfig PER_VMA_LOCK 14180b6cc04fSSuren Baghdasaryan def_bool y 14190b6cc04fSSuren Baghdasaryan depends on ARCH_SUPPORTS_PER_VMA_LOCK && MMU && SMP 14200b6cc04fSSuren Baghdasaryan help 14210b6cc04fSSuren Baghdasaryan Allow per-vma locking during page fault handling. 14220b6cc04fSSuren Baghdasaryan 14230b6cc04fSSuren Baghdasaryan This feature allows locking each virtual memory area separately when 14240b6cc04fSSuren Baghdasaryan handling page faults instead of taking mmap_lock. 14250b6cc04fSSuren Baghdasaryan 1426c2508ec5SLinus Torvaldsconfig LOCK_MM_AND_FIND_VMA 1427c2508ec5SLinus Torvalds bool 1428c2508ec5SLinus Torvalds depends on !STACK_GROWSUP 1429c2508ec5SLinus Torvalds 14308f23f5dbSJason Gunthorpeconfig IOMMU_MM_DATA 14318f23f5dbSJason Gunthorpe bool 14328f23f5dbSJason Gunthorpe 143312af2b83SMike Rapoport (IBM)config EXECMEM 143412af2b83SMike Rapoport (IBM) bool 143512af2b83SMike Rapoport (IBM) 143687482708SMike Rapoport (Microsoft)config NUMA_MEMBLKS 143787482708SMike Rapoport (Microsoft) bool 143887482708SMike Rapoport (Microsoft) 1439b0c4e27cSMike Rapoport (Microsoft)config NUMA_EMU 1440b0c4e27cSMike Rapoport (Microsoft) bool "NUMA emulation" 1441b0c4e27cSMike Rapoport (Microsoft) depends on NUMA_MEMBLKS 1442a24f2fb7SHuacai Chen depends on X86 || GENERIC_ARCH_NUMA 1443b0c4e27cSMike Rapoport (Microsoft) help 1444b0c4e27cSMike Rapoport (Microsoft) Enable NUMA emulation. A flat machine will be split 1445b0c4e27cSMike Rapoport (Microsoft) into virtual nodes when booted with "numa=fake=N", where N is the 1446b0c4e27cSMike Rapoport (Microsoft) number of nodes. This is only useful for debugging. 1447b0c4e27cSMike Rapoport (Microsoft) 1448bcc9d04eSMark Brownconfig ARCH_HAS_USER_SHADOW_STACK 1449bcc9d04eSMark Brown bool 1450bcc9d04eSMark Brown help 1451bcc9d04eSMark Brown The architecture has hardware support for userspace shadow call 1452bcc9d04eSMark Brown stacks (eg, x86 CET, arm64 GCS or RISC-V Zicfiss). 1453bcc9d04eSMark Brown 14546375e95fSQi Zhengconfig ARCH_SUPPORTS_PT_RECLAIM 14556375e95fSQi Zheng def_bool n 14566375e95fSQi Zheng 14576375e95fSQi Zhengconfig PT_RECLAIM 14586375e95fSQi Zheng bool "reclaim empty user page table pages" 14596375e95fSQi Zheng default y 14606375e95fSQi Zheng depends on ARCH_SUPPORTS_PT_RECLAIM && MMU && SMP 14616375e95fSQi Zheng select MMU_GATHER_RCU_TABLE_FREE 14626375e95fSQi Zheng help 14636375e95fSQi Zheng Try to reclaim empty user page table pages in paths other than munmap 14646375e95fSQi Zheng and exit_mmap path. 14656375e95fSQi Zheng 14666375e95fSQi Zheng Note: now only empty user PTE page table pages will be reclaimed. 14676375e95fSQi Zheng 14684c89792eSDavid Hildenbrandconfig FIND_NORMAL_PAGE 14694c89792eSDavid Hildenbrand def_bool n 14706375e95fSQi Zheng 14712224d848SSeongJae Parksource "mm/damon/Kconfig" 14722224d848SSeongJae Park 147359e0b520SChristoph Hellwigendmenu 1474