hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/mm/Kconfig
....@@ -1,3 +1,4 @@
1
+# SPDX-License-Identifier: GPL-2.0-only
12
23 menu "Memory Management options"
34
....@@ -11,23 +12,24 @@
1112 default DISCONTIGMEM_MANUAL if ARCH_DISCONTIGMEM_DEFAULT
1213 default SPARSEMEM_MANUAL if ARCH_SPARSEMEM_DEFAULT
1314 default FLATMEM_MANUAL
15
+ help
16
+ This option allows you to change some of the ways that
17
+ Linux manages its memory internally. Most users will
18
+ only have one option here selected by the architecture
19
+ configuration. This is normal.
1420
1521 config FLATMEM_MANUAL
1622 bool "Flat Memory"
1723 depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE
1824 help
19
- This option allows you to change some of the ways that
20
- Linux manages its memory internally. Most users will
21
- only have one option here: FLATMEM. This is normal
22
- and a correct option.
25
+ This option is best suited for non-NUMA systems with
26
+ flat address space. The FLATMEM is the most efficient
27
+ system in terms of performance and resource consumption
28
+ and it is the best option for smaller systems.
2329
24
- Some users of more advanced features like NUMA and
25
- memory hotplug may have different options here.
26
- DISCONTIGMEM is a more mature, better tested system,
27
- but is incompatible with memory hotplug and may suffer
28
- decreased performance over SPARSEMEM. If unsure between
29
- "Sparse Memory" and "Discontiguous Memory", choose
30
- "Discontiguous Memory".
30
+ For systems that have holes in their physical address
31
+ spaces and for features like NUMA and memory hotplug,
32
+ choose "Sparse Memory".
3133
3234 If unsure, choose this option (Flat Memory) over any other.
3335
....@@ -38,29 +40,26 @@
3840 This option provides enhanced support for discontiguous
3941 memory systems, over FLATMEM. These systems have holes
4042 in their physical address spaces, and this option provides
41
- more efficient handling of these holes. However, the vast
42
- majority of hardware has quite flat address spaces, and
43
- can have degraded performance from the extra overhead that
44
- this option imposes.
43
+ more efficient handling of these holes.
4544
46
- Many NUMA configurations will have this as the only option.
45
+ Although "Discontiguous Memory" is still used by several
46
+ architectures, it is considered deprecated in favor of
47
+ "Sparse Memory".
4748
48
- If unsure, choose "Flat Memory" over this option.
49
+ If unsure, choose "Sparse Memory" over this option.
4950
5051 config SPARSEMEM_MANUAL
5152 bool "Sparse Memory"
5253 depends on ARCH_SPARSEMEM_ENABLE
5354 help
5455 This will be the only option for some systems, including
55
- memory hotplug systems. This is normal.
56
+ memory hot-plug systems. This is normal.
5657
57
- For many other systems, this will be an alternative to
58
- "Discontiguous Memory". This option provides some potential
59
- performance benefits, along with decreased code complexity,
60
- but it is newer, and more experimental.
58
+ This option provides efficient support for systems with
59
+ holes is their physical address space and allows memory
60
+ hot-plug and hot-remove.
6161
62
- If unsure, choose "Discontiguous Memory" or "Flat Memory"
63
- over this option.
62
+ If unsure, choose "Flat Memory" over this option.
6463
6564 endchoice
6665
....@@ -89,13 +88,9 @@
8988 def_bool y
9089 depends on DISCONTIGMEM || NUMA
9190
92
-config HAVE_MEMORY_PRESENT
93
- def_bool y
94
- depends on ARCH_HAVE_MEMORY_PRESENT || SPARSEMEM
95
-
9691 #
9792 # SPARSEMEM_EXTREME (which is the default) does some bootmem
98
-# allocations when memory_present() is called. If this cannot
93
+# allocations when sparse_init() is called. If this cannot
9994 # be done on your architecture, select this option. However,
10095 # statically allocating the mem_section[] array can potentially
10196 # consume vast quantities of .bss, so be careful.
....@@ -123,26 +118,25 @@
123118 depends on SPARSEMEM && SPARSEMEM_VMEMMAP_ENABLE
124119 default y
125120 help
126
- SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise
127
- pfn_to_page and page_to_pfn operations. This is the most
128
- efficient option when sufficient kernel resources are available.
129
-
130
-config HAVE_MEMBLOCK
131
- bool
132
-
133
-config HAVE_MEMBLOCK_NODE_MAP
134
- bool
121
+ SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise
122
+ pfn_to_page and page_to_pfn operations. This is the most
123
+ efficient option when sufficient kernel resources are available.
135124
136125 config HAVE_MEMBLOCK_PHYS_MAP
137126 bool
138127
139
-config HAVE_GENERIC_GUP
128
+config HAVE_FAST_GUP
129
+ depends on MMU
140130 bool
141131
142
-config ARCH_DISCARD_MEMBLOCK
132
+# Don't discard allocated memory used to track "memory" and "reserved" memblocks
133
+# after early boot, so it can still be used to test for validity of memory.
134
+# Also, memblocks are updated with memory hot(un)plug.
135
+config ARCH_KEEP_MEMBLOCK
143136 bool
144137
145
-config NO_BOOTMEM
138
+# Keep arch NUMA mapping infrastructure post-init.
139
+config NUMA_KEEP_MEMINFO
146140 bool
147141
148142 config MEMORY_ISOLATION
....@@ -158,23 +152,25 @@
158152 # eventually, we can have this option just 'select SPARSEMEM'
159153 config MEMORY_HOTPLUG
160154 bool "Allow for memory hot-add"
155
+ select MEMORY_ISOLATION
161156 depends on SPARSEMEM || X86_64_ACPI_NUMA
162157 depends on ARCH_ENABLE_MEMORY_HOTPLUG
158
+ depends on 64BIT || BROKEN
159
+ select NUMA_KEEP_MEMINFO if NUMA
163160
164161 config MEMORY_HOTPLUG_SPARSE
165162 def_bool y
166163 depends on SPARSEMEM && MEMORY_HOTPLUG
167164
168165 config MEMORY_HOTPLUG_DEFAULT_ONLINE
169
- bool "Online the newly added memory blocks by default"
170
- default n
171
- depends on MEMORY_HOTPLUG
172
- help
166
+ bool "Online the newly added memory blocks by default"
167
+ depends on MEMORY_HOTPLUG
168
+ help
173169 This option sets the default policy setting for memory hotplug
174170 onlining policy (/sys/devices/system/memory/auto_online_blocks) which
175171 determines what happens to newly added memory regions. Policy setting
176172 can always be changed at runtime.
177
- See Documentation/memory-hotplug.txt for more information.
173
+ See Documentation/admin-guide/mm/memory-hotplug.rst for more information.
178174
179175 Say Y here if you want all hot-plugged memory blocks to appear in
180176 'online' state by default.
....@@ -183,7 +179,6 @@
183179
184180 config MEMORY_HOTREMOVE
185181 bool "Allow for memory hot remove"
186
- select MEMORY_ISOLATION
187182 select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
188183 depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
189184 depends on MIGRATION
....@@ -194,6 +189,9 @@
194189 # Default to 4 for wider testing, though 8 might be more appropriate.
195190 # ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock.
196191 # PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes.
192
+# SPARC32 allocates multiple pte tables within a single page, and therefore
193
+# a per-page lock leads to problems when multiple tables need to be locked
194
+# at the same time (e.g. copy_page_range()).
197195 # DEBUG_SPINLOCK and DEBUG_LOCK_ALLOC spinlock_t also enlarge struct page.
198196 #
199197 config SPLIT_PTLOCK_CPUS
....@@ -201,6 +199,7 @@
201199 default "999999" if !MMU
202200 default "999999" if ARM && !CPU_CACHE_VIPT
203201 default "999999" if PARISC && !PA20
202
+ default "999999" if SPARC32
204203 default "4"
205204
206205 config ARCH_ENABLE_SPLIT_PMD_PTLOCK
....@@ -234,14 +233,25 @@
234233 select MIGRATION
235234 depends on MMU
236235 help
237
- Compaction is the only memory management component to form
238
- high order (larger physically contiguous) memory blocks
239
- reliably. The page allocator relies on compaction heavily and
240
- the lack of the feature can lead to unexpected OOM killer
241
- invocations for high order memory requests. You shouldn't
242
- disable this option unless there really is a strong reason for
243
- it and then we would be really interested to hear about that at
244
- linux-mm@kvack.org.
236
+ Compaction is the only memory management component to form
237
+ high order (larger physically contiguous) memory blocks
238
+ reliably. The page allocator relies on compaction heavily and
239
+ the lack of the feature can lead to unexpected OOM killer
240
+ invocations for high order memory requests. You shouldn't
241
+ disable this option unless there really is a strong reason for
242
+ it and then we would be really interested to hear about that at
243
+ linux-mm@kvack.org.
244
+
245
+#
246
+# support for free page reporting
247
+config PAGE_REPORTING
248
+ bool "Free page reporting"
249
+ def_bool n
250
+ help
251
+ Free page reporting allows for the incremental acquisition of
252
+ free pages from the buddy allocator for the purpose of reporting
253
+ those pages to another entity, such as a hypervisor, so that the
254
+ memory can be freed within the host for other uses.
245255
246256 #
247257 # support for page migration
....@@ -264,6 +274,9 @@
264274 config ARCH_ENABLE_THP_MIGRATION
265275 bool
266276
277
+config CONTIG_ALLOC
278
+ def_bool (MEMORY_ISOLATION && COMPACTION) || CMA
279
+
267280 config PHYS_ADDR_T_64BIT
268281 def_bool 64BIT
269282
....@@ -277,11 +290,6 @@
277290 by default when ZONE_DMA or HIGHMEM is selected, but you
278291 may say n to override this.
279292
280
-config NR_QUICK
281
- int
282
- depends on QUICKLIST
283
- default "1"
284
-
285293 config VIRT_TO_BUS
286294 bool
287295 help
....@@ -293,10 +301,12 @@
293301 config MMU_NOTIFIER
294302 bool
295303 select SRCU
304
+ select INTERVAL_TREE
296305
297306 config KSM
298307 bool "Enable KSM for page merging"
299308 depends on MMU
309
+ select XXHASH
300310 help
301311 Enable Kernel Samepage Merging: KSM periodically scans those areas
302312 of an application's address space that an app has advised may be
....@@ -309,10 +319,10 @@
309319 root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
310320
311321 config DEFAULT_MMAP_MIN_ADDR
312
- int "Low address space to protect from user allocation"
322
+ int "Low address space to protect from user allocation"
313323 depends on MMU
314
- default 4096
315
- help
324
+ default 4096
325
+ help
316326 This is the portion of low virtual memory which should be protected
317327 from userspace allocation. Keeping a user from writing to low pages
318328 can help reduce the impact of kernel NULL pointer bugs.
....@@ -373,13 +383,13 @@
373383 This option specifies the initial value of this option. The default
374384 of 1 says that all excess pages should be trimmed.
375385
376
- See Documentation/nommu-mmap.txt for more information.
386
+ See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
377387
378388 config TRANSPARENT_HUGEPAGE
379389 bool "Transparent Hugepage Support"
380
- depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT_FULL
390
+ depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE
381391 select COMPACTION
382
- select RADIX_TREE_MULTIORDER
392
+ select XARRAY_MULTI
383393 help
384394 Transparent Hugepages allows the kernel to use huge pages and
385395 huge tlb transparently to the applications whenever possible.
....@@ -415,7 +425,7 @@
415425 endchoice
416426
417427 config ARCH_WANTS_THP_SWAP
418
- def_bool n
428
+ def_bool n
419429
420430 config THP_SWAP
421431 def_bool y
....@@ -427,10 +437,6 @@
427437
428438 For selection by architectures with reasonable THP sizes.
429439
430
-config TRANSPARENT_HUGE_PAGECACHE
431
- def_bool y
432
- depends on TRANSPARENT_HUGEPAGE
433
-
434440 #
435441 # UP and nommu archs use km based percpu allocator
436442 #
....@@ -441,7 +447,6 @@
441447
442448 config CLEANCACHE
443449 bool "Enable cleancache driver to cache clean pages if tmem is present"
444
- default n
445450 help
446451 Cleancache can be thought of as a page-granularity victim cache
447452 for clean pages that the kernel's pageframe replacement algorithm
....@@ -465,7 +470,6 @@
465470 config FRONTSWAP
466471 bool "Enable frontswap to cache swap pages if tmem is present"
467472 depends on SWAP
468
- default n
469473 help
470474 Frontswap is so named because it can be thought of as the opposite
471475 of a "backing" store for a swap device. The data is stored into
....@@ -481,7 +485,7 @@
481485
482486 config CMA
483487 bool "Contiguous Memory Allocator"
484
- depends on HAVE_MEMBLOCK && MMU
488
+ depends on MMU
485489 select MIGRATION
486490 select MEMORY_ISOLATION
487491 help
....@@ -491,6 +495,15 @@
491495 be allocated from it. This way, the kernel can use the memory for
492496 pagecache and when a subsystem requests for contiguous area, the
493497 allocated pages are migrated away to serve the contiguous request.
498
+
499
+ If unsure, say "n".
500
+
501
+config CMA_INACTIVE
502
+ bool "CMA not active to system"
503
+ depends on CMA
504
+ help
505
+ This forbids the CMA to active its pages to system memory, to keep
506
+ page from CMA never be borrowed by system.
494507
495508 If unsure, say "n".
496509
....@@ -509,16 +522,31 @@
509522 help
510523 Turns on the DebugFS interface for CMA.
511524
525
+config CMA_DEBUGFS_BITMAP_HEX
526
+ bool "CMA debugfs add bitmap_hex node"
527
+ depends on CMA_DEBUGFS
528
+ help
529
+ Turns on the bitmap_hex node under DEBUGFS, shows the bitmap in hex
530
+ format.
531
+
532
+config CMA_SYSFS
533
+ bool "CMA information through sysfs interface"
534
+ depends on CMA && SYSFS
535
+ help
536
+ This option exposes some sysfs attributes to get information
537
+ from CMA.
538
+
512539 config CMA_AREAS
513540 int "Maximum count of the CMA areas"
514541 depends on CMA
542
+ default 19 if NUMA
515543 default 7
516544 help
517545 CMA allows to create CMA areas for particular purpose, mainly,
518546 used as device private area. This parameter sets the maximum
519547 number of CMA area in the system.
520548
521
- If unsure, leave the default value "7".
549
+ If unsure, leave the default value "7" in UMA and "19" in NUMA.
522550
523551 config MEM_SOFT_DIRTY
524552 bool "Track memory changes"
....@@ -535,9 +563,7 @@
535563 config ZSWAP
536564 bool "Compressed cache for swap pages (EXPERIMENTAL)"
537565 depends on FRONTSWAP && CRYPTO=y
538
- select CRYPTO_LZO
539566 select ZPOOL
540
- default n
541567 help
542568 A lightweight compressed cache for swap pages. It takes
543569 pages that are in the process of being swapped out and attempts to
....@@ -552,16 +578,131 @@
552578 they have not be fully explored on the large set of potential
553579 configurations and workloads that exist.
554580
581
+choice
582
+ prompt "Compressed cache for swap pages default compressor"
583
+ depends on ZSWAP
584
+ default ZSWAP_COMPRESSOR_DEFAULT_LZO
585
+ help
586
+ Selects the default compression algorithm for the compressed cache
587
+ for swap pages.
588
+
589
+ For an overview what kind of performance can be expected from
590
+ a particular compression algorithm please refer to the benchmarks
591
+ available at the following LWN page:
592
+ https://lwn.net/Articles/751795/
593
+
594
+ If in doubt, select 'LZO'.
595
+
596
+ The selection made here can be overridden by using the kernel
597
+ command line 'zswap.compressor=' option.
598
+
599
+config ZSWAP_COMPRESSOR_DEFAULT_DEFLATE
600
+ bool "Deflate"
601
+ select CRYPTO_DEFLATE
602
+ help
603
+ Use the Deflate algorithm as the default compression algorithm.
604
+
605
+config ZSWAP_COMPRESSOR_DEFAULT_LZO
606
+ bool "LZO"
607
+ select CRYPTO_LZO
608
+ help
609
+ Use the LZO algorithm as the default compression algorithm.
610
+
611
+config ZSWAP_COMPRESSOR_DEFAULT_842
612
+ bool "842"
613
+ select CRYPTO_842
614
+ help
615
+ Use the 842 algorithm as the default compression algorithm.
616
+
617
+config ZSWAP_COMPRESSOR_DEFAULT_LZ4
618
+ bool "LZ4"
619
+ select CRYPTO_LZ4
620
+ help
621
+ Use the LZ4 algorithm as the default compression algorithm.
622
+
623
+config ZSWAP_COMPRESSOR_DEFAULT_LZ4HC
624
+ bool "LZ4HC"
625
+ select CRYPTO_LZ4HC
626
+ help
627
+ Use the LZ4HC algorithm as the default compression algorithm.
628
+
629
+config ZSWAP_COMPRESSOR_DEFAULT_ZSTD
630
+ bool "zstd"
631
+ select CRYPTO_ZSTD
632
+ help
633
+ Use the zstd algorithm as the default compression algorithm.
634
+endchoice
635
+
636
+config ZSWAP_COMPRESSOR_DEFAULT
637
+ string
638
+ depends on ZSWAP
639
+ default "deflate" if ZSWAP_COMPRESSOR_DEFAULT_DEFLATE
640
+ default "lzo" if ZSWAP_COMPRESSOR_DEFAULT_LZO
641
+ default "842" if ZSWAP_COMPRESSOR_DEFAULT_842
642
+ default "lz4" if ZSWAP_COMPRESSOR_DEFAULT_LZ4
643
+ default "lz4hc" if ZSWAP_COMPRESSOR_DEFAULT_LZ4HC
644
+ default "zstd" if ZSWAP_COMPRESSOR_DEFAULT_ZSTD
645
+ default ""
646
+
647
+choice
648
+ prompt "Compressed cache for swap pages default allocator"
649
+ depends on ZSWAP
650
+ default ZSWAP_ZPOOL_DEFAULT_ZBUD
651
+ help
652
+ Selects the default allocator for the compressed cache for
653
+ swap pages.
654
+ The default is 'zbud' for compatibility, however please do
655
+ read the description of each of the allocators below before
656
+ making a right choice.
657
+
658
+ The selection made here can be overridden by using the kernel
659
+ command line 'zswap.zpool=' option.
660
+
661
+config ZSWAP_ZPOOL_DEFAULT_ZBUD
662
+ bool "zbud"
663
+ select ZBUD
664
+ help
665
+ Use the zbud allocator as the default allocator.
666
+
667
+config ZSWAP_ZPOOL_DEFAULT_Z3FOLD
668
+ bool "z3fold"
669
+ select Z3FOLD
670
+ help
671
+ Use the z3fold allocator as the default allocator.
672
+
673
+config ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
674
+ bool "zsmalloc"
675
+ select ZSMALLOC
676
+ help
677
+ Use the zsmalloc allocator as the default allocator.
678
+endchoice
679
+
680
+config ZSWAP_ZPOOL_DEFAULT
681
+ string
682
+ depends on ZSWAP
683
+ default "zbud" if ZSWAP_ZPOOL_DEFAULT_ZBUD
684
+ default "z3fold" if ZSWAP_ZPOOL_DEFAULT_Z3FOLD
685
+ default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
686
+ default ""
687
+
688
+config ZSWAP_DEFAULT_ON
689
+ bool "Enable the compressed cache for swap pages by default"
690
+ depends on ZSWAP
691
+ help
692
+ If selected, the compressed cache for swap pages will be enabled
693
+ at boot, otherwise it will be disabled.
694
+
695
+ The selection made here can be overridden by using the kernel
696
+ command line 'zswap.enabled=' option.
697
+
555698 config ZPOOL
556699 tristate "Common API for compressed memory storage"
557
- default n
558700 help
559701 Compressed memory storage API. This allows using either zbud or
560702 zsmalloc.
561703
562704 config ZBUD
563705 tristate "Low (Up to 2x) density storage for compressed pages"
564
- default n
565706 help
566707 A special purpose allocator for storing compressed pages.
567708 It is designed to store up to two compressed pages per physical
....@@ -572,7 +713,6 @@
572713 config Z3FOLD
573714 tristate "Up to 3x density storage for compressed pages"
574715 depends on ZPOOL
575
- default n
576716 help
577717 A special purpose allocator for storing compressed pages.
578718 It is designed to store up to three compressed pages per physical
....@@ -582,7 +722,6 @@
582722 config ZSMALLOC
583723 tristate "Memory allocator for compressed pages"
584724 depends on MMU
585
- default n
586725 help
587726 zsmalloc is a slab-based memory allocator designed to store
588727 compressed RAM pages. zsmalloc uses virtual memory mapping
....@@ -590,19 +729,6 @@
590729 non-standard allocator interface where a handle, not a pointer, is
591730 returned by an alloc(). This handle must be mapped in order to
592731 access the allocated space.
593
-
594
-config PGTABLE_MAPPING
595
- bool "Use page table mapping to access object in zsmalloc"
596
- depends on ZSMALLOC
597
- help
598
- By default, zsmalloc uses a copy-based object mapping method to
599
- access allocations that span two pages. However, if a particular
600
- architecture (ex, ARM) performs VM mapping faster than copying,
601
- then you should select this. This causes zsmalloc to use page table
602
- mapping rather than copying for object mapping.
603
-
604
- You can check speed with zsmalloc benchmark:
605
- https://github.com/spartacus06/zsmapbench
606732
607733 config ZSMALLOC_STAT
608734 bool "Export zsmalloc statistics"
....@@ -613,22 +739,6 @@
613739 statistics about whats happening in zsmalloc and exports that
614740 information to userspace via debugfs.
615741 If unsure, say N.
616
-
617
-config MM_EVENT_STAT
618
- bool "Track per-process MM event"
619
- depends on MMU
620
- help
621
- This option enables per-process mm event stat(e.g., fault, reclaim,
622
- compaction and so on ) with some interval(Default is 0.5sec).
623
- Admin can see the stat from trace file via debugfs(e.g.,
624
- /sys/kernel/debug/tracing/trace)
625
-
626
- It includes max/average memory allocation latency for the interval
627
- as well as event count so that admin can see what happens in VM side
628
- (how many each event happens and how much processes spent time for
629
- the MM event). If it's too large, that would be not good situation.
630
-
631
- System can dump the trace into bugreport when user allows the dump.
632742
633743 config GENERIC_EARLY_IOREMAP
634744 bool
....@@ -649,25 +759,31 @@
649759
650760 config DEFERRED_STRUCT_PAGE_INIT
651761 bool "Defer initialisation of struct pages to kthreads"
652
- default n
653
- depends on NO_BOOTMEM
654762 depends on SPARSEMEM
655763 depends on !NEED_PER_CPU_KM
656764 depends on 64BIT
765
+ select PADATA
657766 help
658767 Ordinarily all struct pages are initialised during early boot in a
659768 single thread. On very large machines this can take a considerable
660769 amount of time. If this option is set, large machines will bring up
661
- a subset of memmap at boot and then initialise the rest in parallel
662
- by starting one-off "pgdatinitX" kernel thread for each node X. This
663
- has a potential performance impact on processes running early in the
770
+ a subset of memmap at boot and then initialise the rest in parallel.
771
+ This has a potential performance impact on tasks running early in the
664772 lifetime of the system until these kthreads finish the
665773 initialisation.
774
+
775
+config PAGE_IDLE_FLAG
776
+ bool
777
+ select PAGE_EXTENSION if !64BIT
778
+ help
779
+ This adds PG_idle and PG_young flags to 'struct page'. PTE Accessed
780
+ bit writers can set the state of the bit in the flags so that PTE
781
+ Accessed bit readers may avoid disturbance.
666782
667783 config IDLE_PAGE_TRACKING
668784 bool "Enable idle page tracking"
669785 depends on SYSFS && MMU
670
- select PAGE_EXTENSION if !64BIT
786
+ select PAGE_IDLE_FLAG
671787 help
672788 This feature allows to estimate the amount of user pages that have
673789 not been touched during a given period of time. This information can
....@@ -677,8 +793,7 @@
677793 See Documentation/admin-guide/mm/idle_page_tracking.rst for
678794 more details.
679795
680
-# arch_add_memory() comprehends device memory
681
-config ARCH_HAS_ZONE_DEVICE
796
+config ARCH_HAS_PTE_DEVMAP
682797 bool
683798
684799 config ZONE_DEVICE
....@@ -686,8 +801,8 @@
686801 depends on MEMORY_HOTPLUG
687802 depends on MEMORY_HOTREMOVE
688803 depends on SPARSEMEM_VMEMMAP
689
- depends on ARCH_HAS_ZONE_DEVICE
690
- select RADIX_TREE_MULTIORDER
804
+ depends on ARCH_HAS_PTE_DEVMAP
805
+ select XARRAY_MULTI
691806
692807 help
693808 Device memory hotplug support allows for establishing pmem,
....@@ -698,42 +813,20 @@
698813
699814 If FS_DAX is enabled, then say Y.
700815
701
-config ARCH_HAS_HMM
702
- bool
703
- default y
704
- depends on (X86_64 || PPC64)
705
- depends on ZONE_DEVICE
706
- depends on MMU && 64BIT
707
- depends on MEMORY_HOTPLUG
708
- depends on MEMORY_HOTREMOVE
709
- depends on SPARSEMEM_VMEMMAP
710
-
711
-config MIGRATE_VMA_HELPER
712
- bool
713
-
714816 config DEV_PAGEMAP_OPS
715817 bool
716818
717
-config HMM
718
- bool
719
- select MMU_NOTIFIER
720
- select MIGRATE_VMA_HELPER
721
-
819
+#
820
+# Helpers to mirror range of the CPU page tables of a process into device page
821
+# tables.
822
+#
722823 config HMM_MIRROR
723
- bool "HMM mirror CPU page table into a device page table"
724
- depends on ARCH_HAS_HMM
725
- select HMM
726
- help
727
- Select HMM_MIRROR if you want to mirror range of the CPU page table of a
728
- process into a device page table. Here, mirror means "keep synchronized".
729
- Prerequisites: the device must provide the ability to write-protect its
730
- page tables (at PAGE_SIZE granularity), and must be able to recover from
731
- the resulting potential page faults.
824
+ bool
825
+ depends on MMU
732826
733827 config DEVICE_PRIVATE
734828 bool "Unaddressable device memory (GPU memory, ...)"
735
- depends on ARCH_HAS_HMM
736
- select HMM
829
+ depends on ZONE_DEVICE
737830 select DEV_PAGEMAP_OPS
738831
739832 help
....@@ -741,16 +834,8 @@
741834 memory; i.e., memory that is only accessible from the device (or
742835 group of devices). You likely also want to select HMM_MIRROR.
743836
744
-config DEVICE_PUBLIC
745
- bool "Addressable device memory (like GPU memory)"
746
- depends on ARCH_HAS_HMM
747
- select HMM
748
- select DEV_PAGEMAP_OPS
749
-
750
- help
751
- Allows creation of struct pages to represent addressable device
752
- memory; i.e., memory that is accessible from both the device and
753
- the CPU
837
+config VMAP_PFN
838
+ bool
754839
755840 config FRAME_VECTOR
756841 bool
....@@ -762,22 +847,71 @@
762847
763848 config PERCPU_STATS
764849 bool "Collect percpu memory statistics"
765
- default n
766850 help
767851 This feature collects and exposes statistics via debugfs. The
768852 information includes global and per chunk statistics, which can
769853 be used to help understand percpu memory usage.
770854
855
+config ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT
856
+ def_bool n
857
+
858
+config SPECULATIVE_PAGE_FAULT
859
+ bool "Speculative page faults"
860
+ default y
861
+ depends on ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT
862
+ depends on MMU && SMP && !NUMA
863
+ help
864
+ Try to handle user space page faults without holding the mmap_sem.
865
+
866
+ This should allow better concurrency for massively threaded process
867
+ since the page fault handler will not wait for other threads memory
868
+ layout change to be done, assuming that this change is done in another
869
+ part of the process's memory space. This type of page fault is named
870
+ speculative page fault.
871
+
872
+ If the speculative page fault fails because of a concurrency is
873
+ detected or because underlying PMD or PTE tables are not yet
874
+ allocating, it is failing its processing and a classic page fault
875
+ is then tried.
876
+
771877 config GUP_BENCHMARK
772
- bool "Enable infrastructure for get_user_pages_fast() benchmarking"
773
- default n
878
+ bool "Enable infrastructure for get_user_pages() and related calls benchmarking"
774879 help
775880 Provides /sys/kernel/debug/gup_benchmark that helps with testing
776
- performance of get_user_pages_fast().
881
+ performance of get_user_pages() and related calls.
777882
778883 See tools/testing/selftests/vm/gup_benchmark.c
779884
885
+config GUP_GET_PTE_LOW_HIGH
886
+ bool
887
+
888
+config READ_ONLY_THP_FOR_FS
889
+ bool "Read-only THP for filesystems (EXPERIMENTAL)"
890
+ depends on TRANSPARENT_HUGEPAGE && SHMEM
891
+
892
+ help
893
+ Allow khugepaged to put read-only file-backed pages in THP.
894
+
895
+ This is marked experimental because it is a new feature. Write
896
+ support of file THPs will be developed in the next few release
897
+ cycles.
898
+
780899 config ARCH_HAS_PTE_SPECIAL
781900 bool
782901
902
+#
903
+# Some architectures require a special hugepage directory format that is
904
+# required to support multiple hugepage sizes. For example a4fe3ce76
905
+# "powerpc/mm: Allow more flexible layouts for hugepage pagetables"
906
+# introduced it on powerpc. This allows for a more flexible hugepage
907
+# pagetable layouts.
908
+#
909
+config ARCH_HAS_HUGEPD
910
+ bool
911
+
912
+config MAPPING_DIRTY_HELPERS
913
+ bool
914
+
915
+source "mm/damon/Kconfig"
916
+
783917 endmenu