Kconfig 40 KB

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