Kconfig 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. menu "Memory Management options"
  3. config SELECT_MEMORY_MODEL
  4. def_bool y
  5. depends on ARCH_SELECT_MEMORY_MODEL
  6. choice
  7. prompt "Memory model"
  8. depends on SELECT_MEMORY_MODEL
  9. default DISCONTIGMEM_MANUAL if ARCH_DISCONTIGMEM_DEFAULT
  10. default SPARSEMEM_MANUAL if ARCH_SPARSEMEM_DEFAULT
  11. default FLATMEM_MANUAL
  12. help
  13. This option allows you to change some of the ways that
  14. Linux manages its memory internally. Most users will
  15. only have one option here selected by the architecture
  16. configuration. This is normal.
  17. config FLATMEM_MANUAL
  18. bool "Flat Memory"
  19. depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE
  20. help
  21. This option is best suited for non-NUMA systems with
  22. flat address space. The FLATMEM is the most efficient
  23. system in terms of performance and resource consumption
  24. and it is the best option for smaller systems.
  25. For systems that have holes in their physical address
  26. spaces and for features like NUMA and memory hotplug,
  27. choose "Sparse Memory".
  28. If unsure, choose this option (Flat Memory) over any other.
  29. config DISCONTIGMEM_MANUAL
  30. bool "Discontiguous Memory"
  31. depends on ARCH_DISCONTIGMEM_ENABLE
  32. help
  33. This option provides enhanced support for discontiguous
  34. memory systems, over FLATMEM. These systems have holes
  35. in their physical address spaces, and this option provides
  36. more efficient handling of these holes.
  37. Although "Discontiguous Memory" is still used by several
  38. architectures, it is considered deprecated in favor of
  39. "Sparse Memory".
  40. If unsure, choose "Sparse Memory" over this option.
  41. config SPARSEMEM_MANUAL
  42. bool "Sparse Memory"
  43. depends on ARCH_SPARSEMEM_ENABLE
  44. help
  45. This will be the only option for some systems, including
  46. memory hot-plug systems. This is normal.
  47. This option provides efficient support for systems with
  48. holes is their physical address space and allows memory
  49. hot-plug and hot-remove.
  50. If unsure, choose "Flat Memory" over this option.
  51. endchoice
  52. config DISCONTIGMEM
  53. def_bool y
  54. depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL
  55. config SPARSEMEM
  56. def_bool y
  57. depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL
  58. config FLATMEM
  59. def_bool y
  60. depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL
  61. config FLAT_NODE_MEM_MAP
  62. def_bool y
  63. depends on !SPARSEMEM
  64. #
  65. # Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's
  66. # to represent different areas of memory. This variable allows
  67. # those dependencies to exist individually.
  68. #
  69. config NEED_MULTIPLE_NODES
  70. def_bool y
  71. depends on DISCONTIGMEM || NUMA
  72. #
  73. # SPARSEMEM_EXTREME (which is the default) does some bootmem
  74. # allocations when sparse_init() is called. If this cannot
  75. # be done on your architecture, select this option. However,
  76. # statically allocating the mem_section[] array can potentially
  77. # consume vast quantities of .bss, so be careful.
  78. #
  79. # This option will also potentially produce smaller runtime code
  80. # with gcc 3.4 and later.
  81. #
  82. config SPARSEMEM_STATIC
  83. bool
  84. #
  85. # Architecture platforms which require a two level mem_section in SPARSEMEM
  86. # must select this option. This is usually for architecture platforms with
  87. # an extremely sparse physical address space.
  88. #
  89. config SPARSEMEM_EXTREME
  90. def_bool y
  91. depends on SPARSEMEM && !SPARSEMEM_STATIC
  92. config SPARSEMEM_VMEMMAP_ENABLE
  93. bool
  94. config SPARSEMEM_VMEMMAP
  95. bool "Sparse Memory virtual memmap"
  96. depends on SPARSEMEM && SPARSEMEM_VMEMMAP_ENABLE
  97. default y
  98. help
  99. SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise
  100. pfn_to_page and page_to_pfn operations. This is the most
  101. efficient option when sufficient kernel resources are available.
  102. config HAVE_MEMBLOCK_PHYS_MAP
  103. bool
  104. config HAVE_FAST_GUP
  105. depends on MMU
  106. bool
  107. # Don't discard allocated memory used to track "memory" and "reserved" memblocks
  108. # after early boot, so it can still be used to test for validity of memory.
  109. # Also, memblocks are updated with memory hot(un)plug.
  110. config ARCH_KEEP_MEMBLOCK
  111. bool
  112. # Keep arch NUMA mapping infrastructure post-init.
  113. config NUMA_KEEP_MEMINFO
  114. bool
  115. config MEMORY_ISOLATION
  116. bool
  117. #
  118. # Only be set on architectures that have completely implemented memory hotplug
  119. # feature. If you are not sure, don't touch it.
  120. #
  121. config HAVE_BOOTMEM_INFO_NODE
  122. def_bool n
  123. # eventually, we can have this option just 'select SPARSEMEM'
  124. config MEMORY_HOTPLUG
  125. bool "Allow for memory hot-add"
  126. select MEMORY_ISOLATION
  127. depends on SPARSEMEM || X86_64_ACPI_NUMA
  128. depends on ARCH_ENABLE_MEMORY_HOTPLUG
  129. depends on 64BIT || BROKEN
  130. select NUMA_KEEP_MEMINFO if NUMA
  131. config MEMORY_HOTPLUG_SPARSE
  132. def_bool y
  133. depends on SPARSEMEM && MEMORY_HOTPLUG
  134. config MEMORY_HOTPLUG_DEFAULT_ONLINE
  135. bool "Online the newly added memory blocks by default"
  136. depends on MEMORY_HOTPLUG
  137. help
  138. This option sets the default policy setting for memory hotplug
  139. onlining policy (/sys/devices/system/memory/auto_online_blocks) which
  140. determines what happens to newly added memory regions. Policy setting
  141. can always be changed at runtime.
  142. See Documentation/admin-guide/mm/memory-hotplug.rst for more information.
  143. Say Y here if you want all hot-plugged memory blocks to appear in
  144. 'online' state by default.
  145. Say N here if you want the default policy to keep all hot-plugged
  146. memory blocks in 'offline' state.
  147. config MEMORY_HOTREMOVE
  148. bool "Allow for memory hot remove"
  149. select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
  150. depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
  151. depends on MIGRATION
  152. # Heavily threaded applications may benefit from splitting the mm-wide
  153. # page_table_lock, so that faults on different parts of the user address
  154. # space can be handled with less contention: split it at this NR_CPUS.
  155. # Default to 4 for wider testing, though 8 might be more appropriate.
  156. # ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock.
  157. # PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes.
  158. # SPARC32 allocates multiple pte tables within a single page, and therefore
  159. # a per-page lock leads to problems when multiple tables need to be locked
  160. # at the same time (e.g. copy_page_range()).
  161. # DEBUG_SPINLOCK and DEBUG_LOCK_ALLOC spinlock_t also enlarge struct page.
  162. #
  163. config SPLIT_PTLOCK_CPUS
  164. int
  165. default "999999" if !MMU
  166. default "999999" if ARM && !CPU_CACHE_VIPT
  167. default "999999" if PARISC && !PA20
  168. default "999999" if SPARC32
  169. default "4"
  170. config ARCH_ENABLE_SPLIT_PMD_PTLOCK
  171. bool
  172. #
  173. # support for memory balloon
  174. config MEMORY_BALLOON
  175. bool
  176. #
  177. # support for memory balloon compaction
  178. config BALLOON_COMPACTION
  179. bool "Allow for balloon memory compaction/migration"
  180. def_bool y
  181. depends on COMPACTION && MEMORY_BALLOON
  182. help
  183. Memory fragmentation introduced by ballooning might reduce
  184. significantly the number of 2MB contiguous memory blocks that can be
  185. used within a guest, thus imposing performance penalties associated
  186. with the reduced number of transparent huge pages that could be used
  187. by the guest workload. Allowing the compaction & migration for memory
  188. pages enlisted as being part of memory balloon devices avoids the
  189. scenario aforementioned and helps improving memory defragmentation.
  190. #
  191. # support for memory compaction
  192. config COMPACTION
  193. bool "Allow for memory compaction"
  194. def_bool y
  195. select MIGRATION
  196. depends on MMU
  197. help
  198. Compaction is the only memory management component to form
  199. high order (larger physically contiguous) memory blocks
  200. reliably. The page allocator relies on compaction heavily and
  201. the lack of the feature can lead to unexpected OOM killer
  202. invocations for high order memory requests. You shouldn't
  203. disable this option unless there really is a strong reason for
  204. it and then we would be really interested to hear about that at
  205. linux-mm@kvack.org.
  206. #
  207. # support for free page reporting
  208. config PAGE_REPORTING
  209. bool "Free page reporting"
  210. def_bool n
  211. help
  212. Free page reporting allows for the incremental acquisition of
  213. free pages from the buddy allocator for the purpose of reporting
  214. those pages to another entity, such as a hypervisor, so that the
  215. memory can be freed within the host for other uses.
  216. #
  217. # support for page migration
  218. #
  219. config MIGRATION
  220. bool "Page migration"
  221. def_bool y
  222. depends on (NUMA || ARCH_ENABLE_MEMORY_HOTREMOVE || COMPACTION || CMA) && MMU
  223. help
  224. Allows the migration of the physical location of pages of processes
  225. while the virtual addresses are not changed. This is useful in
  226. two situations. The first is on NUMA systems to put pages nearer
  227. to the processors accessing. The second is when allocating huge
  228. pages as migration can relocate pages to satisfy a huge page
  229. allocation instead of reclaiming.
  230. config ARCH_ENABLE_HUGEPAGE_MIGRATION
  231. bool
  232. config ARCH_ENABLE_THP_MIGRATION
  233. bool
  234. config CONTIG_ALLOC
  235. def_bool (MEMORY_ISOLATION && COMPACTION) || CMA
  236. config PHYS_ADDR_T_64BIT
  237. def_bool 64BIT
  238. config BOUNCE
  239. bool "Enable bounce buffers"
  240. default y
  241. depends on BLOCK && MMU && (ZONE_DMA || HIGHMEM)
  242. help
  243. Enable bounce buffers for devices that cannot access
  244. the full range of memory available to the CPU. Enabled
  245. by default when ZONE_DMA or HIGHMEM is selected, but you
  246. may say n to override this.
  247. config VIRT_TO_BUS
  248. bool
  249. help
  250. An architecture should select this if it implements the
  251. deprecated interface virt_to_bus(). All new architectures
  252. should probably not select this.
  253. config MMU_NOTIFIER
  254. bool
  255. select SRCU
  256. select INTERVAL_TREE
  257. config KSM
  258. bool "Enable KSM for page merging"
  259. depends on MMU
  260. select XXHASH
  261. help
  262. Enable Kernel Samepage Merging: KSM periodically scans those areas
  263. of an application's address space that an app has advised may be
  264. mergeable. When it finds pages of identical content, it replaces
  265. the many instances by a single page with that content, so
  266. saving memory until one or another app needs to modify the content.
  267. Recommended for use with KVM, or with other duplicative applications.
  268. See Documentation/vm/ksm.rst for more information: KSM is inactive
  269. until a program has madvised that an area is MADV_MERGEABLE, and
  270. root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
  271. config DEFAULT_MMAP_MIN_ADDR
  272. int "Low address space to protect from user allocation"
  273. depends on MMU
  274. default 4096
  275. help
  276. This is the portion of low virtual memory which should be protected
  277. from userspace allocation. Keeping a user from writing to low pages
  278. can help reduce the impact of kernel NULL pointer bugs.
  279. For most ia64, ppc64 and x86 users with lots of address space
  280. a value of 65536 is reasonable and should cause no problems.
  281. On arm and other archs it should not be higher than 32768.
  282. Programs which use vm86 functionality or have some need to map
  283. this low address space will need CAP_SYS_RAWIO or disable this
  284. protection by setting the value to 0.
  285. This value can be changed after boot using the
  286. /proc/sys/vm/mmap_min_addr tunable.
  287. config ARCH_SUPPORTS_MEMORY_FAILURE
  288. bool
  289. config MEMORY_FAILURE
  290. depends on MMU
  291. depends on ARCH_SUPPORTS_MEMORY_FAILURE
  292. bool "Enable recovery from hardware memory errors"
  293. select MEMORY_ISOLATION
  294. select RAS
  295. help
  296. Enables code to recover from some memory failures on systems
  297. with MCA recovery. This allows a system to continue running
  298. even when some of its memory has uncorrected errors. This requires
  299. special hardware support and typically ECC memory.
  300. config HWPOISON_INJECT
  301. tristate "HWPoison pages injector"
  302. depends on MEMORY_FAILURE && DEBUG_KERNEL && PROC_FS
  303. select PROC_PAGE_MONITOR
  304. config NOMMU_INITIAL_TRIM_EXCESS
  305. int "Turn on mmap() excess space trimming before booting"
  306. depends on !MMU
  307. default 1
  308. help
  309. The NOMMU mmap() frequently needs to allocate large contiguous chunks
  310. of memory on which to store mappings, but it can only ask the system
  311. allocator for chunks in 2^N*PAGE_SIZE amounts - which is frequently
  312. more than it requires. To deal with this, mmap() is able to trim off
  313. the excess and return it to the allocator.
  314. If trimming is enabled, the excess is trimmed off and returned to the
  315. system allocator, which can cause extra fragmentation, particularly
  316. if there are a lot of transient processes.
  317. If trimming is disabled, the excess is kept, but not used, which for
  318. long-term mappings means that the space is wasted.
  319. Trimming can be dynamically controlled through a sysctl option
  320. (/proc/sys/vm/nr_trim_pages) which specifies the minimum number of
  321. excess pages there must be before trimming should occur, or zero if
  322. no trimming is to occur.
  323. This option specifies the initial value of this option. The default
  324. of 1 says that all excess pages should be trimmed.
  325. See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
  326. config TRANSPARENT_HUGEPAGE
  327. bool "Transparent Hugepage Support"
  328. depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE
  329. select COMPACTION
  330. select XARRAY_MULTI
  331. help
  332. Transparent Hugepages allows the kernel to use huge pages and
  333. huge tlb transparently to the applications whenever possible.
  334. This feature can improve computing performance to certain
  335. applications by speeding up page faults during memory
  336. allocation, by reducing the number of tlb misses and by speeding
  337. up the pagetable walking.
  338. If memory constrained on embedded, you may want to say N.
  339. choice
  340. prompt "Transparent Hugepage Support sysfs defaults"
  341. depends on TRANSPARENT_HUGEPAGE
  342. default TRANSPARENT_HUGEPAGE_ALWAYS
  343. help
  344. Selects the sysfs defaults for Transparent Hugepage Support.
  345. config TRANSPARENT_HUGEPAGE_ALWAYS
  346. bool "always"
  347. help
  348. Enabling Transparent Hugepage always, can increase the
  349. memory footprint of applications without a guaranteed
  350. benefit but it will work automatically for all applications.
  351. config TRANSPARENT_HUGEPAGE_MADVISE
  352. bool "madvise"
  353. help
  354. Enabling Transparent Hugepage madvise, will only provide a
  355. performance improvement benefit to the applications using
  356. madvise(MADV_HUGEPAGE) but it won't risk to increase the
  357. memory footprint of applications without a guaranteed
  358. benefit.
  359. endchoice
  360. config ARCH_WANTS_THP_SWAP
  361. def_bool n
  362. config THP_SWAP
  363. def_bool y
  364. depends on TRANSPARENT_HUGEPAGE && ARCH_WANTS_THP_SWAP && SWAP
  365. help
  366. Swap transparent huge pages in one piece, without splitting.
  367. XXX: For now, swap cluster backing transparent huge page
  368. will be split after swapout.
  369. For selection by architectures with reasonable THP sizes.
  370. #
  371. # UP and nommu archs use km based percpu allocator
  372. #
  373. config NEED_PER_CPU_KM
  374. depends on !SMP
  375. bool
  376. default y
  377. config CLEANCACHE
  378. bool "Enable cleancache driver to cache clean pages if tmem is present"
  379. help
  380. Cleancache can be thought of as a page-granularity victim cache
  381. for clean pages that the kernel's pageframe replacement algorithm
  382. (PFRA) would like to keep around, but can't since there isn't enough
  383. memory. So when the PFRA "evicts" a page, it first attempts to use
  384. cleancache code to put the data contained in that page into
  385. "transcendent memory", memory that is not directly accessible or
  386. addressable by the kernel and is of unknown and possibly
  387. time-varying size. And when a cleancache-enabled
  388. filesystem wishes to access a page in a file on disk, it first
  389. checks cleancache to see if it already contains it; if it does,
  390. the page is copied into the kernel and a disk access is avoided.
  391. When a transcendent memory driver is available (such as zcache or
  392. Xen transcendent memory), a significant I/O reduction
  393. may be achieved. When none is available, all cleancache calls
  394. are reduced to a single pointer-compare-against-NULL resulting
  395. in a negligible performance hit.
  396. If unsure, say Y to enable cleancache
  397. config FRONTSWAP
  398. bool "Enable frontswap to cache swap pages if tmem is present"
  399. depends on SWAP
  400. help
  401. Frontswap is so named because it can be thought of as the opposite
  402. of a "backing" store for a swap device. The data is stored into
  403. "transcendent memory", memory that is not directly accessible or
  404. addressable by the kernel and is of unknown and possibly
  405. time-varying size. When space in transcendent memory is available,
  406. a significant swap I/O reduction may be achieved. When none is
  407. available, all frontswap calls are reduced to a single pointer-
  408. compare-against-NULL resulting in a negligible performance hit
  409. and swap data is stored as normal on the matching swap device.
  410. If unsure, say Y to enable frontswap.
  411. config CMA
  412. bool "Contiguous Memory Allocator"
  413. depends on MMU
  414. select MIGRATION
  415. select MEMORY_ISOLATION
  416. help
  417. This enables the Contiguous Memory Allocator which allows other
  418. subsystems to allocate big physically-contiguous blocks of memory.
  419. CMA reserves a region of memory and allows only movable pages to
  420. be allocated from it. This way, the kernel can use the memory for
  421. pagecache and when a subsystem requests for contiguous area, the
  422. allocated pages are migrated away to serve the contiguous request.
  423. If unsure, say "n".
  424. config CMA_DEBUG
  425. bool "CMA debug messages (DEVELOPMENT)"
  426. depends on DEBUG_KERNEL && CMA
  427. help
  428. Turns on debug messages in CMA. This produces KERN_DEBUG
  429. messages for every CMA call as well as various messages while
  430. processing calls such as dma_alloc_from_contiguous().
  431. This option does not affect warning and error messages.
  432. config CMA_DEBUGFS
  433. bool "CMA debugfs interface"
  434. depends on CMA && DEBUG_FS
  435. help
  436. Turns on the DebugFS interface for CMA.
  437. config CMA_SYSFS
  438. bool "CMA information through sysfs interface"
  439. depends on CMA && SYSFS
  440. help
  441. This option exposes some sysfs attributes to get information
  442. from CMA.
  443. config CMA_AREAS
  444. int "Maximum count of the CMA areas"
  445. depends on CMA
  446. default 19 if NUMA
  447. default 7
  448. help
  449. CMA allows to create CMA areas for particular purpose, mainly,
  450. used as device private area. This parameter sets the maximum
  451. number of CMA area in the system.
  452. If unsure, leave the default value "7" in UMA and "19" in NUMA.
  453. config MEM_SOFT_DIRTY
  454. bool "Track memory changes"
  455. depends on CHECKPOINT_RESTORE && HAVE_ARCH_SOFT_DIRTY && PROC_FS
  456. select PROC_PAGE_MONITOR
  457. help
  458. This option enables memory changes tracking by introducing a
  459. soft-dirty bit on pte-s. This bit it set when someone writes
  460. into a page just as regular dirty bit, but unlike the latter
  461. it can be cleared by hands.
  462. See Documentation/admin-guide/mm/soft-dirty.rst for more details.
  463. config ZSWAP
  464. bool "Compressed cache for swap pages (EXPERIMENTAL)"
  465. depends on FRONTSWAP && CRYPTO=y
  466. select ZPOOL
  467. help
  468. A lightweight compressed cache for swap pages. It takes
  469. pages that are in the process of being swapped out and attempts to
  470. compress them into a dynamically allocated RAM-based memory pool.
  471. This can result in a significant I/O reduction on swap device and,
  472. in the case where decompressing from RAM is faster that swap device
  473. reads, can also improve workload performance.
  474. This is marked experimental because it is a new feature (as of
  475. v3.11) that interacts heavily with memory reclaim. While these
  476. interactions don't cause any known issues on simple memory setups,
  477. they have not be fully explored on the large set of potential
  478. configurations and workloads that exist.
  479. choice
  480. prompt "Compressed cache for swap pages default compressor"
  481. depends on ZSWAP
  482. default ZSWAP_COMPRESSOR_DEFAULT_LZO
  483. help
  484. Selects the default compression algorithm for the compressed cache
  485. for swap pages.
  486. For an overview what kind of performance can be expected from
  487. a particular compression algorithm please refer to the benchmarks
  488. available at the following LWN page:
  489. https://lwn.net/Articles/751795/
  490. If in doubt, select 'LZO'.
  491. The selection made here can be overridden by using the kernel
  492. command line 'zswap.compressor=' option.
  493. config ZSWAP_COMPRESSOR_DEFAULT_DEFLATE
  494. bool "Deflate"
  495. select CRYPTO_DEFLATE
  496. help
  497. Use the Deflate algorithm as the default compression algorithm.
  498. config ZSWAP_COMPRESSOR_DEFAULT_LZO
  499. bool "LZO"
  500. select CRYPTO_LZO
  501. help
  502. Use the LZO algorithm as the default compression algorithm.
  503. config ZSWAP_COMPRESSOR_DEFAULT_842
  504. bool "842"
  505. select CRYPTO_842
  506. help
  507. Use the 842 algorithm as the default compression algorithm.
  508. config ZSWAP_COMPRESSOR_DEFAULT_LZ4
  509. bool "LZ4"
  510. select CRYPTO_LZ4
  511. help
  512. Use the LZ4 algorithm as the default compression algorithm.
  513. config ZSWAP_COMPRESSOR_DEFAULT_LZ4HC
  514. bool "LZ4HC"
  515. select CRYPTO_LZ4HC
  516. help
  517. Use the LZ4HC algorithm as the default compression algorithm.
  518. config ZSWAP_COMPRESSOR_DEFAULT_ZSTD
  519. bool "zstd"
  520. select CRYPTO_ZSTD
  521. help
  522. Use the zstd algorithm as the default compression algorithm.
  523. endchoice
  524. config ZSWAP_COMPRESSOR_DEFAULT
  525. string
  526. depends on ZSWAP
  527. default "deflate" if ZSWAP_COMPRESSOR_DEFAULT_DEFLATE
  528. default "lzo" if ZSWAP_COMPRESSOR_DEFAULT_LZO
  529. default "842" if ZSWAP_COMPRESSOR_DEFAULT_842
  530. default "lz4" if ZSWAP_COMPRESSOR_DEFAULT_LZ4
  531. default "lz4hc" if ZSWAP_COMPRESSOR_DEFAULT_LZ4HC
  532. default "zstd" if ZSWAP_COMPRESSOR_DEFAULT_ZSTD
  533. default ""
  534. choice
  535. prompt "Compressed cache for swap pages default allocator"
  536. depends on ZSWAP
  537. default ZSWAP_ZPOOL_DEFAULT_ZBUD
  538. help
  539. Selects the default allocator for the compressed cache for
  540. swap pages.
  541. The default is 'zbud' for compatibility, however please do
  542. read the description of each of the allocators below before
  543. making a right choice.
  544. The selection made here can be overridden by using the kernel
  545. command line 'zswap.zpool=' option.
  546. config ZSWAP_ZPOOL_DEFAULT_ZBUD
  547. bool "zbud"
  548. select ZBUD
  549. help
  550. Use the zbud allocator as the default allocator.
  551. config ZSWAP_ZPOOL_DEFAULT_Z3FOLD
  552. bool "z3fold"
  553. select Z3FOLD
  554. help
  555. Use the z3fold allocator as the default allocator.
  556. config ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
  557. bool "zsmalloc"
  558. select ZSMALLOC
  559. help
  560. Use the zsmalloc allocator as the default allocator.
  561. endchoice
  562. config ZSWAP_ZPOOL_DEFAULT
  563. string
  564. depends on ZSWAP
  565. default "zbud" if ZSWAP_ZPOOL_DEFAULT_ZBUD
  566. default "z3fold" if ZSWAP_ZPOOL_DEFAULT_Z3FOLD
  567. default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
  568. default ""
  569. config ZSWAP_DEFAULT_ON
  570. bool "Enable the compressed cache for swap pages by default"
  571. depends on ZSWAP
  572. help
  573. If selected, the compressed cache for swap pages will be enabled
  574. at boot, otherwise it will be disabled.
  575. The selection made here can be overridden by using the kernel
  576. command line 'zswap.enabled=' option.
  577. config ZPOOL
  578. tristate "Common API for compressed memory storage"
  579. help
  580. Compressed memory storage API. This allows using either zbud or
  581. zsmalloc.
  582. config ZBUD
  583. tristate "Low (Up to 2x) density storage for compressed pages"
  584. help
  585. A special purpose allocator for storing compressed pages.
  586. It is designed to store up to two compressed pages per physical
  587. page. While this design limits storage density, it has simple and
  588. deterministic reclaim properties that make it preferable to a higher
  589. density approach when reclaim will be used.
  590. config Z3FOLD
  591. tristate "Up to 3x density storage for compressed pages"
  592. depends on ZPOOL
  593. help
  594. A special purpose allocator for storing compressed pages.
  595. It is designed to store up to three compressed pages per physical
  596. page. It is a ZBUD derivative so the simplicity and determinism are
  597. still there.
  598. config ZSMALLOC
  599. tristate "Memory allocator for compressed pages"
  600. depends on MMU
  601. help
  602. zsmalloc is a slab-based memory allocator designed to store
  603. compressed RAM pages. zsmalloc uses virtual memory mapping
  604. in order to reduce fragmentation. However, this results in a
  605. non-standard allocator interface where a handle, not a pointer, is
  606. returned by an alloc(). This handle must be mapped in order to
  607. access the allocated space.
  608. config ZSMALLOC_STAT
  609. bool "Export zsmalloc statistics"
  610. depends on ZSMALLOC
  611. select DEBUG_FS
  612. help
  613. This option enables code in the zsmalloc to collect various
  614. statistics about whats happening in zsmalloc and exports that
  615. information to userspace via debugfs.
  616. If unsure, say N.
  617. config GENERIC_EARLY_IOREMAP
  618. bool
  619. config MAX_STACK_SIZE_MB
  620. int "Maximum user stack size for 32-bit processes (MB)"
  621. default 80
  622. range 8 2048
  623. depends on STACK_GROWSUP && (!64BIT || COMPAT)
  624. help
  625. This is the maximum stack size in Megabytes in the VM layout of 32-bit
  626. user processes when the stack grows upwards (currently only on parisc
  627. arch). The stack will be located at the highest memory address minus
  628. the given value, unless the RLIMIT_STACK hard limit is changed to a
  629. smaller value in which case that is used.
  630. A sane initial value is 80 MB.
  631. config DEFERRED_STRUCT_PAGE_INIT
  632. bool "Defer initialisation of struct pages to kthreads"
  633. depends on SPARSEMEM
  634. depends on !NEED_PER_CPU_KM
  635. depends on 64BIT
  636. select PADATA
  637. help
  638. Ordinarily all struct pages are initialised during early boot in a
  639. single thread. On very large machines this can take a considerable
  640. amount of time. If this option is set, large machines will bring up
  641. a subset of memmap at boot and then initialise the rest in parallel.
  642. This has a potential performance impact on tasks running early in the
  643. lifetime of the system until these kthreads finish the
  644. initialisation.
  645. config PAGE_IDLE_FLAG
  646. bool
  647. select PAGE_EXTENSION if !64BIT
  648. help
  649. This adds PG_idle and PG_young flags to 'struct page'. PTE Accessed
  650. bit writers can set the state of the bit in the flags so that PTE
  651. Accessed bit readers may avoid disturbance.
  652. config IDLE_PAGE_TRACKING
  653. bool "Enable idle page tracking"
  654. depends on SYSFS && MMU
  655. select PAGE_IDLE_FLAG
  656. help
  657. This feature allows to estimate the amount of user pages that have
  658. not been touched during a given period of time. This information can
  659. be useful to tune memory cgroup limits and/or for job placement
  660. within a compute cluster.
  661. See Documentation/admin-guide/mm/idle_page_tracking.rst for
  662. more details.
  663. config ARCH_HAS_PTE_DEVMAP
  664. bool
  665. config ZONE_DEVICE
  666. bool "Device memory (pmem, HMM, etc...) hotplug support"
  667. depends on MEMORY_HOTPLUG
  668. depends on MEMORY_HOTREMOVE
  669. depends on SPARSEMEM_VMEMMAP
  670. depends on ARCH_HAS_PTE_DEVMAP
  671. select XARRAY_MULTI
  672. help
  673. Device memory hotplug support allows for establishing pmem,
  674. or other device driver discovered memory regions, in the
  675. memmap. This allows pfn_to_page() lookups of otherwise
  676. "device-physical" addresses which is needed for using a DAX
  677. mapping in an O_DIRECT operation, among other things.
  678. If FS_DAX is enabled, then say Y.
  679. config DEV_PAGEMAP_OPS
  680. bool
  681. #
  682. # Helpers to mirror range of the CPU page tables of a process into device page
  683. # tables.
  684. #
  685. config HMM_MIRROR
  686. bool
  687. depends on MMU
  688. config DEVICE_PRIVATE
  689. bool "Unaddressable device memory (GPU memory, ...)"
  690. depends on ZONE_DEVICE
  691. select DEV_PAGEMAP_OPS
  692. help
  693. Allows creation of struct pages to represent unaddressable device
  694. memory; i.e., memory that is only accessible from the device (or
  695. group of devices). You likely also want to select HMM_MIRROR.
  696. config VMAP_PFN
  697. bool
  698. config FRAME_VECTOR
  699. bool
  700. config ARCH_USES_HIGH_VMA_FLAGS
  701. bool
  702. config ARCH_HAS_PKEYS
  703. bool
  704. config PERCPU_STATS
  705. bool "Collect percpu memory statistics"
  706. help
  707. This feature collects and exposes statistics via debugfs. The
  708. information includes global and per chunk statistics, which can
  709. be used to help understand percpu memory usage.
  710. config ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT
  711. def_bool n
  712. config SPECULATIVE_PAGE_FAULT
  713. bool "Speculative page faults"
  714. default y
  715. depends on ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT
  716. depends on MMU && SMP
  717. help
  718. Try to handle user space page faults without holding the mmap_sem.
  719. This should allow better concurrency for massively threaded process
  720. since the page fault handler will not wait for other threads memory
  721. layout change to be done, assuming that this change is done in another
  722. part of the process's memory space. This type of page fault is named
  723. speculative page fault.
  724. If the speculative page fault fails because of a concurrency is
  725. detected or because underlying PMD or PTE tables are not yet
  726. allocating, it is failing its processing and a classic page fault
  727. is then tried.
  728. config GUP_BENCHMARK
  729. bool "Enable infrastructure for get_user_pages() and related calls benchmarking"
  730. help
  731. Provides /sys/kernel/debug/gup_benchmark that helps with testing
  732. performance of get_user_pages() and related calls.
  733. See tools/testing/selftests/vm/gup_benchmark.c
  734. config GUP_GET_PTE_LOW_HIGH
  735. bool
  736. config READ_ONLY_THP_FOR_FS
  737. bool "Read-only THP for filesystems (EXPERIMENTAL)"
  738. depends on TRANSPARENT_HUGEPAGE && SHMEM
  739. help
  740. Allow khugepaged to put read-only file-backed pages in THP.
  741. This is marked experimental because it is a new feature. Write
  742. support of file THPs will be developed in the next few release
  743. cycles.
  744. config ARCH_HAS_PTE_SPECIAL
  745. bool
  746. #
  747. # Some architectures require a special hugepage directory format that is
  748. # required to support multiple hugepage sizes. For example a4fe3ce76
  749. # "powerpc/mm: Allow more flexible layouts for hugepage pagetables"
  750. # introduced it on powerpc. This allows for a more flexible hugepage
  751. # pagetable layouts.
  752. #
  753. config ARCH_HAS_HUGEPD
  754. bool
  755. config MAPPING_DIRTY_HELPERS
  756. bool
  757. source "mm/damon/Kconfig"
  758. endmenu