Kconfig

Memory Management options

CONFIG_ARCH_NO_SWAP

Unknown

CONFIG_SWAP Support for paging of anonymous memory (swap)

On

This option allows you to choose whether you want to have support for so called swap devices or swap files in your kernel that are used to provide more virtual memory than the actual RAM present in your computer. If unsure say Y.

If SWAP

CONFIG_ZSWAP Compressed cache for swap pages

On

A lightweight compressed cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a dynamically allocated RAM-based memory pool. This can result in a significant I/O reduction on swap device and, in the case where decompressing from RAM is faster than swap device reads, can also improve workload performance.

If ZSWAP

CONFIG_ZSWAP_DEFAULT_ON Enable the compressed cache for swap pages by default

On

If selected, the compressed cache for swap pages will be enabled at boot, otherwise it will be disabled.

The selection made here can be overridden by using the kernel command line 'zswap.enabled=' option.

CONFIG_ZSWAP_SHRINKER_DEFAULT_ON Shrink the zswap pool on memory pressure

On

If selected, the zswap shrinker will be enabled, and the pages stored in the zswap pool will become available for reclaim (i.e written back to the backing swap device) on memory pressure.

This means that zswap writeback could happen even if the pool is not yet full, or the cgroup zswap limit has not been reached, reducing the chance that cold pages will reside in the zswap pool and consume memory indefinitely.

Default compressor

Selects the default compression algorithm for the compressed cache for swap pages.

For an overview what kind of performance can be expected from a particular compression algorithm please refer to the benchmarks available at the following LWN page: https://lwn.net/Articles/751795/

If in doubt, select 'LZO'.

The selection made here can be overridden by using the kernel command line 'zswap.compressor=' option.

CONFIG_ZSWAP_COMPRESSOR_DEFAULT_DEFLATE Deflate

Off

Use the Deflate algorithm as the default compression algorithm.

CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZO LZO

On

Use the LZO algorithm as the default compression algorithm.

CONFIG_ZSWAP_COMPRESSOR_DEFAULT_842 842

Off

Use the 842 algorithm as the default compression algorithm.

CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4 LZ4

Off

Use the LZ4 algorithm as the default compression algorithm.

CONFIG_ZSWAP_COMPRESSOR_DEFAULT_LZ4HC LZ4HC

Off

Use the LZ4HC algorithm as the default compression algorithm.

CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD zstd

Off

Use the zstd algorithm as the default compression algorithm.

End of Default compressor

CONFIG_ZSMALLOC

  • Off
  • Module
  • Built in

Zsmalloc allocator options

Zsmalloc is a common backend allocator for zswap & zram

CONFIG_ZSMALLOC_STAT Export zsmalloc statistics

On

This option enables code in the zsmalloc to collect various statistics about what's happening in zsmalloc and exports that information to userspace via debugfs. If unsure, say N.

CONFIG_ZSMALLOC_CHAIN_SIZE Maximum number of physical pages per-zspage

This option sets the upper limit on the number of physical pages that a zmalloc page (zspage) can consist of. The optimal zspage chain size is calculated for each size class during the initialization of the pool.

Changing this option can alter the characteristics of size classes, such as the number of pages per zspage and the number of objects per zspage. This can also result in different configurations of the pool, as zsmalloc merges size classes with similar characteristics.

For more information, see zsmalloc documentation.

End of Zsmalloc allocator options

Slab allocator options

CONFIG_SLUB_TINY Configure for minimal memory footprint

Unknown

Configures the slab allocator in a way to achieve minimal memory footprint, sacrificing scalability, debugging and other features. This is intended only for the smallest system that had used the SLOB allocator and is not recommended for systems with more than 16MB RAM.

If unsure, say N.

CONFIG_SLAB_MERGE_DEFAULT Allow slab caches to be merged

On

For reduced kernel memory fragmentation, slab caches can be merged when they share the same size and other characteristics. This carries a risk of kernel heap overflows being able to overwrite objects from merged caches (and more easily control cache layout), which makes such heap attacks easier to exploit by attackers. By keeping caches unmerged, these kinds of exploits can usually only damage objects in the same cache. To disable merging at runtime, "slab_nomerge" can be passed on the kernel command line.

Default
  • y

CONFIG_SLAB_FREELIST_RANDOM Randomize slab freelist

On

Randomizes the freelist order used on creating new pages. This security feature reduces the predictability of the kernel slab allocator against heap overflows.

CONFIG_SLAB_FREELIST_HARDENED Harden slab freelist metadata

On

Many kernel heap attacks try to target slab cache metadata and other infrastructure. This options makes minor performance sacrifices to harden the kernel slab allocator against common freelist exploit methods.

CONFIG_SLAB_BUCKETS Support allocation from separate kmalloc buckets

On

Kernel heap attacks frequently depend on being able to create specifically-sized allocations with user-controlled contents that will be allocated into the same kmalloc bucket as a target object. To avoid sharing these allocation buckets, provide an explicitly separated set of buckets to be used for user-controlled allocations. This may very slightly increase memory fragmentation, though in practice it's only a handful of extra pages since the bulk of user-controlled allocations are relatively long-lived.

If unsure, say Y.

CONFIG_SLUB_STATS Enable performance statistics

On

The statistics are useful to debug slab allocation behavior in order find ways to optimize the allocator. This should never be enabled for production use since keeping statistics slows down the allocator by a few percentage points. The slabinfo command supports the determination of the most active slabs to figure out which slabs are relevant to a particular load. Try running: slabinfo -DA

CONFIG_KMALLOC_PARTITION_CACHES Partitioned slab caches for normal kmalloc

On

A hardening feature that creates multiple isolated copies of slab caches for normal kmalloc allocations. This makes it more difficult to exploit memory-safety vulnerabilities by attacking vulnerable co-located memory objects. Several modes are provided.

Currently the number of copies is set to 16, a reasonably large value that effectively diverges the memory objects allocated for different subsystems or modules into different caches, at the expense of a limited degree of memory and CPU overhead that relates to hardware and system workload.

If KMALLOC_PARTITION_CACHES

Partitioned slab cache mode

Selects the slab cache partitioning mode.

CONFIG_KMALLOC_PARTITION_RANDOM Randomize slab caches for normal kmalloc

On

Randomly pick a slab cache based on code address and a per-boot random seed.

This makes it harder for attackers to predict object co-location. The placement is random: while attackers don't know which kmalloc cache an object will be allocated from, they might circumvent the randomization by retrying attacks across multiple machines until the target objects are co-located.

CONFIG_KMALLOC_PARTITION_TYPED Type based slab cache selection for normal kmalloc

Unknown

Rely on Clang's allocation tokens to choose a slab cache, where token IDs are derived from the allocated type.

Unlike KMALLOC_PARTITION_RANDOM, cache assignment is deterministic based on type, which guarantees that objects of certain types are not placed in the same cache. This effectively mitigates certain classes of exploits that probabilistic defenses like KMALLOC_PARTITION_RANDOM only make harder but not impossible. However, this also means the cache assignment is predictable.

Clang's default token ID calculation returns a bounded hash with disjoint ranges for pointer-containing and pointerless objects: when used as the slab cache index, this prevents buffer overflows on primitive buffers from directly corrupting pointer-containing objects.

The current effectiveness of Clang's type inference can be judged by -Rpass=alloc-token, which provides diagnostics where (after dead-code elimination) type inference failed.

Requires Clang 22 or later.

End of Partitioned slab cache mode

CONFIG_RANDOM_KMALLOC_CACHES

Unknown

Transitional config for migration to KMALLOC_PARTITION_CACHES.

End of Slab allocator options

CONFIG_SHUFFLE_PAGE_ALLOCATOR Page allocator randomization

On

Randomization of the page allocator improves the average utilization of a direct-mapped memory-side-cache. See section 5.2.27 Heterogeneous Memory Attribute Table (HMAT) in the ACPI 6.2a specification for an example of how a platform advertises the presence of a memory-side-cache. There are also incidental security benefits as it reduces the predictability of page allocations to compliment SLAB_FREELIST_RANDOM, but the default granularity of shuffling on the MAX_PAGE_ORDER i.e, 10th order of pages is selected based on cache utilization benefits on x86.

While the randomization improves cache utilization it may negatively impact workloads on platforms without a cache. For this reason, by default, the randomization is not enabled even if SHUFFLE_PAGE_ALLOCATOR=y. The randomization may be force enabled with the 'page_alloc.shuffle' kernel command line parameter.

Say Y if unsure.

CONFIG_COMPAT_BRK Disable heap randomization

On

Randomizing heap placement makes heap exploits harder, but it also breaks ancient binaries (including anything libc5 based). This option changes the bootup default to heap randomization disabled, and can be overridden at runtime by setting /proc/sys/kernel/randomize_va_space to 2.

On non-ancient distros (post-2000 ones) N is usually a safe choice.

Default
  • y

CONFIG_MMAP_ALLOW_UNINITIALIZED Allow mmapped anonymous memory to be uninitialized

Unknown

Normally, and according to the Linux spec, anonymous memory obtained from mmap() has its contents cleared before it is passed to userspace. Enabling this config option allows you to request that mmap() skip that if it is given an MAP_UNINITIALIZED flag, thus providing a huge performance boost. If this option is not enabled, then the flag will be ignored.

This is taken advantage of by uClibc's malloc(), and also by ELF-FDPIC binfmt's brk and stack allocator.

Because of the obvious security issues, this option should only be enabled on embedded devices where you control what is run in userspace. Since that isn't generally a problem on no-MMU systems, it is normally safe to say Y here.

See Documentation/admin-guide/mm/nommu-mmap.rst for more information.

CONFIG_SELECT_MEMORY_MODEL

Unknown
  • Depends on
Default
  • y if

Memory model

This option allows you to change some of the ways that Linux manages its memory internally. Most users will only have one option here selected by the architecture configuration. This is normal.

CONFIG_FLATMEM_MANUAL Flat Memory

Unknown

This option is best suited for non-NUMA systems with flat address space. The FLATMEM is the most efficient system in terms of performance and resource consumption and it is the best option for smaller systems.

For systems that have holes in their physical address spaces and for features like NUMA and memory hotplug, choose "Sparse Memory".

If unsure, choose this option (Flat Memory) over any other.

CONFIG_SPARSEMEM_MANUAL Sparse Memory

Unknown

This will be the only option for some systems, including memory hot-plug systems. This is normal.

This option provides efficient support for systems with holes is their physical address space and allows memory hot-plug and hot-remove.

If unsure, choose "Flat Memory" over this option.

End of Memory model

CONFIG_SPARSEMEM_STATIC

Unknown

CONFIG_SPARSEMEM_VMEMMAP_ENABLE

On

CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP

On

CONFIG_ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP

On

CONFIG_HAVE_MEMBLOCK_PHYS_MAP

Unknown

CONFIG_HAVE_GUP_FAST

On
  • Depends on

CONFIG_ARCH_KEEP_MEMBLOCK

On

CONFIG_NUMA_KEEP_MEMINFO

On

CONFIG_MEMORY_ISOLATION

On

CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG

On

If MEMORY_HOTPLUG

Memory Hotplug Default Online Type

Default memory type for hotplugged memory.

This option sets the default policy setting for memory hotplug onlining policy (/sys/devices/system/memory/auto_online_blocks) which determines what happens to newly added memory regions. Policy setting can always be changed at runtime.

The default is 'offline'.

Select offline to defer onlining to drivers and user policy. Select auto to let the kernel choose what zones to utilize. Select online_kernel to generally allow kernel usage of this memory. Select online_movable to generally disallow kernel usage of this memory.

Example kernel usage would be page structs and page tables.

See Documentation/admin-guide/mm/memory-hotplug.rst for more information.

CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE offline

On

Hotplugged memory will not be onlined by default. Choose this for systems with drivers and user policy that handle onlining of hotplug memory policy.

CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO auto

Off

Select this if you want the kernel to automatically online hotplugged memory into the zone it thinks is reasonable. This memory may be utilized for kernel data.

CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL kernel

Off

Select this if you want the kernel to automatically online hotplugged memory into a zone capable of being used for kernel data. This typically means ZONE_NORMAL.

CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE movable

Off

Select this if you want the kernel to automatically online hotplug memory into ZONE_MOVABLE. This memory will generally not be utilized for kernel data.

This should only be used when the admin knows sufficient ZONE_NORMAL memory is available to describe hotplug memory, otherwise hotplug memory may fail to online. For example, sufficient kernel-capable memory (ZONE_NORMAL) must be available to allocate page structs to describe ZONE_MOVABLE.

End of Memory Hotplug Default Online Type

CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE

On

CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK

On

CONFIG_BALLOON

On

CONFIG_BALLOON_MIGRATION Allow for balloon memory migration

On

Allow for migration of pages inflated in a memory balloon such that they can be allocated from memory areas only available for movable allocations (e.g., ZONE_MOVABLE, CMA) and such that they can be migrated for memory defragmentation purposes by memory compaction.

CONFIG_COMPACTION Allow for memory compaction

On

Compaction is the only memory management component to form high order (larger physically contiguous) memory blocks reliably. The page allocator relies on compaction heavily and the lack of the feature can lead to unexpected OOM killer invocations for high order memory requests. You shouldn't disable this option unless there really is a strong reason for it and then we would be really interested to hear about that at linux-mm@kvack.org.

Default
  • y if

If COMPACTION

CONFIG_PAGE_REPORTING Free page reporting

On

Free page reporting allows for the incremental acquisition of free pages from the buddy allocator for the purpose of reporting those pages to another entity, such as a hypervisor, so that the memory can be freed within the host for other uses.

CONFIG_NUMA_MIGRATION NUMA page migration

On

Support the migration of pages to other NUMA nodes, available to user space through interfaces like migrate_pages(), move_pages(), and mbind(). Selecting this option also enables support for page demotion for memory tiering.

  • Depends on &&
  • SelectsMIGRATION if &&
Default
  • y if &&

CONFIG_MIGRATION

On
  • Depends on

CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION

On

CONFIG_ARCH_HAS_PMD_SOFTLEAVES

On

CONFIG_HUGETLB_PAGE_SIZE_VARIABLE

Unknown

Allows the pageblock_order value to be dynamic instead of just standard HUGETLB_PAGE_ORDER when there are multiple HugeTLB page sizes available on a platform.

Note that the pageblock_order cannot exceed MAX_PAGE_ORDER and will be clamped down to MAX_PAGE_ORDER.

Default
  • n

CONFIG_PCP_BATCH_SCALE_MAX Maximum scale factor of PCP (Per-CPU pageset) batch allocate/free

In page allocator, PCP (Per-CPU pageset) is refilled and drained in batches. The batch number is scaled automatically to improve page allocation/free throughput. But too large scale factor may hurt latency. This option sets the upper limit of scale factor to limit the maximum latency.

  • Range[0 6]
Default
  • 5

CONFIG_PHYS_ADDR_T_64BIT

On
Default

CONFIG_KSM Enable KSM for page merging

On

Enable Kernel Samepage Merging: KSM periodically scans those areas of an application's address space that an app has advised may be mergeable. When it finds pages of identical content, it replaces the many instances by a single page with that content, so saving memory until one or another app needs to modify the content. Recommended for use with KVM, or with other duplicative applications. See Documentation/mm/ksm.rst for more information: KSM is inactive until a program has madvised that an area is MADV_MERGEABLE, and root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).

  • Depends on
  • SelectsXXHASH if

CONFIG_DEFAULT_MMAP_MIN_ADDR Low address space to protect from user allocation

This is the portion of low virtual memory which should be protected from userspace allocation. Keeping a user from writing to low pages can help reduce the impact of kernel NULL pointer bugs.

For most arm64, ppc64 and x86 users with lots of address space a value of 65536 is reasonable and should cause no problems. On arm and other archs it should not be higher than 32768. Programs which use vm86 functionality or have some need to map this low address space will need CAP_SYS_RAWIO or disable this protection by setting the value to 0.

This value can be changed after boot using the /proc/sys/vm/mmap_min_addr tunable.

  • Depends on
Default
  • 4096 if

CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE

On

If MEMORY_FAILURE

CONFIG_NOMMU_INITIAL_TRIM_EXCESS Turn on mmap() excess space trimming before booting

Unknown

The NOMMU mmap() frequently needs to allocate large contiguous chunks of memory on which to store mappings, but it can only ask the system allocator for chunks in 2^N*PAGE_SIZE amounts - which is frequently more than it requires. To deal with this, mmap() is able to trim off the excess and return it to the allocator.

If trimming is enabled, the excess is trimmed off and returned to the system allocator, which can cause extra fragmentation, particularly if there are a lot of transient processes.

If trimming is disabled, the excess is kept, but not used, which for long-term mappings means that the space is wasted.

Trimming can be dynamically controlled through a sysctl option (/proc/sys/vm/nr_trim_pages) which specifies the minimum number of excess pages there must be before trimming should occur, or zero if no trimming is to occur.

This option specifies the initial value of this option. The default of 1 says that all excess pages should be trimmed.

See Documentation/admin-guide/mm/nommu-mmap.rst for more information.

  • Depends on!
Default
  • 1 if !

CONFIG_ARCH_WANT_GENERAL_HUGETLB

On

CONFIG_ARCH_WANTS_THP_SWAP

On
Default
  • n

CONFIG_PERSISTENT_HUGE_ZERO_FOLIO Allocate a PMD sized folio for zeroing

On

Enable this option to reduce the runtime refcounting overhead of the huge zero folio and expand the places in the kernel that can use huge zero folios. For instance, block I/O benefits from access to large folios for zeroing memory.

With this option enabled, the huge zero folio is allocated once and never freed. One full huge page's worth of memory shall be used.

Say Y if your system has lots of memory. Say N if you are memory constrained.

CONFIG_MM_ID

On
Default
  • n

CONFIG_TRANSPARENT_HUGEPAGE Transparent Hugepage Support

On

Transparent Hugepages allows the kernel to use huge pages and huge tlb transparently to the applications whenever possible. This feature can improve computing performance to certain applications by speeding up page faults during memory allocation, by reducing the number of tlb misses and by speeding up the pagetable walking.

If memory constrained on embedded, you may want to say N.

If TRANSPARENT_HUGEPAGE

Transparent Hugepage Support sysfs defaults

Selects the sysfs defaults for Transparent Hugepage Support.

CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS always

On

Enabling Transparent Hugepage always, can increase the memory footprint of applications without a guaranteed benefit but it will work automatically for all applications.

CONFIG_TRANSPARENT_HUGEPAGE_MADVISE madvise

Off

Enabling Transparent Hugepage madvise, will only provide a performance improvement benefit to the applications using madvise(MADV_HUGEPAGE) but it won't risk to increase the memory footprint of applications without a guaranteed benefit.

CONFIG_TRANSPARENT_HUGEPAGE_NEVER never

Off

Disable Transparent Hugepage by default. It can still be enabled at runtime via sysfs.

End of Transparent Hugepage Support sysfs defaults

Shmem hugepage allocation defaults

Selects the hugepage allocation policy defaults for the internal shmem mount.

The selection made here can be overridden by using the kernel command line 'transparent_hugepage_shmem=' option.

CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER never

On

Disable hugepage allocation for shmem mount by default. It can still be enabled with the kernel command line 'transparent_hugepage_shmem=' option or at runtime via sysfs knob. Note that madvise(MADV_COLLAPSE) can still cause transparent huge pages to be obtained even if this mode is specified.

CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ALWAYS always

Off

Always attempt to allocate hugepage for shmem mount, can increase the memory footprint of applications without a guaranteed benefit but it will work automatically for all applications.

CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_WITHIN_SIZE within_size

Off

Enable hugepage allocation for shmem mount if the allocation will be fully within the i_size. This configuration also takes into account any madvise(MADV_HUGEPAGE) hints that may be provided by the applications.

CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ADVISE advise

Off

Enable hugepage allocation for the shmem mount exclusively when applications supply the madvise(MADV_HUGEPAGE) hint. This ensures that hugepages are used only in response to explicit requests from applications.

End of Shmem hugepage allocation defaults

Tmpfs hugepage allocation defaults

Selects the hugepage allocation policy defaults for the tmpfs mount.

The selection made here can be overridden by using the kernel command line 'transparent_hugepage_tmpfs=' option.

CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER never

On

Disable hugepage allocation for tmpfs mount by default. It can still be enabled with the kernel command line 'transparent_hugepage_tmpfs=' option. Note that madvise(MADV_COLLAPSE) can still cause transparent huge pages to be obtained even if this mode is specified.

CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ALWAYS always

Off

Always attempt to allocate hugepage for tmpfs mount, can increase the memory footprint of applications without a guaranteed benefit but it will work automatically for all applications.

CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_WITHIN_SIZE within_size

Off

Enable hugepage allocation for tmpfs mount if the allocation will be fully within the i_size. This configuration also takes into account any madvise(MADV_HUGEPAGE) hints that may be provided by the applications.

CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ADVISE advise

Off

Enable hugepage allocation for the tmpfs mount exclusively when applications supply the madvise(MADV_HUGEPAGE) hint. This ensures that hugepages are used only in response to explicit requests from applications.

End of Tmpfs hugepage allocation defaults

CONFIG_NO_PAGE_MAPCOUNT No per-page mapcount (EXPERIMENTAL)

On

Do not maintain per-page mapcounts for pages part of larger allocations, such as transparent huge pages.

When this config option is enabled, some interfaces that relied on this information will rely on less-precise per-allocation information instead: for example, using the average per-page mapcount in such a large allocation instead of the per-page mapcount.

EXPERIMENTAL because the impact of some changes is still unclear.

CONFIG_ASYNC_KERNEL_PGTABLE_FREE

On
Default
  • n

CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU

Unknown

CONFIG_NEED_PER_CPU_KM

Unknown
  • Depends on! || !
Default
  • y if ! || !

CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK

On

CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK

On

CONFIG_USE_PERCPU_NUMA_NODE_ID

On

CONFIG_HAVE_SETUP_PER_CPU_AREA

On

CONFIG_CMA Contiguous Memory Allocator

On

This enables the Contiguous Memory Allocator which allows other subsystems to allocate big physically-contiguous blocks of memory. CMA reserves a region of memory and allows only movable pages to be allocated from it. This way, the kernel can use the memory for pagecache and when a subsystem requests for contiguous area, the allocated pages are migrated away to serve the contiguous request.

If unsure, say "n".

If CMA

CONFIG_CMA_DEBUGFS CMA debugfs interface

On

Turns on the DebugFS interface for CMA.

CONFIG_CMA_SYSFS CMA information through sysfs interface

On

This option exposes some sysfs attributes to get information from CMA.

CONFIG_CMA_AREAS Maximum count of the CMA areas

CMA allows to create CMA areas for particular purpose, mainly, used as device private area. This parameter sets the maximum number of CMA area in the system.

If unsure, leave the default value "8" in UMA and "20" in NUMA.

Defaults

CONFIG_ARCH_FORCE_MAX_ORDER

Unknown

CONFIG_PAGE_BLOCK_MAX_ORDER Page Block Order Upper Limit

The page block order refers to the power of two number of pages that are physically contiguous and can have a migrate type associated to them. The maximum size of the page block order is at least limited by ARCH_FORCE_MAX_ORDER/MAX_PAGE_ORDER.

This config adds a new upper limit of default page block order when the page block order is required to be smaller than ARCH_FORCE_MAX_ORDER/MAX_PAGE_ORDER or other limits (see include/linux/pageblock-flags.h for details).

Reducing pageblock order can negatively impact THP generation success rate. If your workloads use THP heavily, please use this option with caution.

Don't change if unsure.

  • Range[1 10] if =0
  • Range[1 ] if !=0
Defaults
  • 10 if =0
  • if !=0

CONFIG_GENERIC_EARLY_IOREMAP

On

CONFIG_STACK_MAX_DEFAULT_SIZE_MB Default maximum user stack size for 32-bit processes (MB)

Unknown

This is the maximum stack size in Megabytes in the VM layout of 32-bit user processes when the stack grows upwards (currently only on parisc arch) when the RLIMIT_STACK hard limit is unlimited.

A sane initial value is 100 MB.

CONFIG_DEFERRED_STRUCT_PAGE_INIT Defer initialisation of struct pages to kthreads

On

Ordinarily all struct pages are initialised during early boot in a single thread. On very large machines this can take a considerable amount of time. If this option is set, large machines will bring up a subset of memmap at boot and then initialise the rest in parallel. This has a potential performance impact on tasks running early in the lifetime of the system until these kthreads finish the initialisation.

CONFIG_PAGE_IDLE_FLAG

On

This adds PG_idle and PG_young flags to 'struct page'. PTE Accessed bit writers can set the state of the bit in the flags so that PTE Accessed bit readers may avoid disturbance.

CONFIG_IDLE_PAGE_TRACKING Enable idle page tracking

On

This feature allows to estimate the amount of user pages that have not been touched during a given period of time. This information can be useful to tune memory cgroup limits and/or for job placement within a compute cluster.

See Documentation/admin-guide/mm/idle_page_tracking.rst for more details.

CONFIG_ARCH_HAS_CPU_CACHE_ALIASING

Unknown

CONFIG_ARCH_HAS_CACHE_LINE_SIZE

On

CONFIG_ARCH_HAS_CURRENT_STACK_POINTER

On

In support of HARDENED_USERCOPY performing stack variable lifetime checking, an architecture-agnostic way to find the stack pointer is needed. Once an architecture defines an unsigned long global register alias named "current_stack_pointer", this config can be selected.

CONFIG_ARCH_HAS_ZONE_DMA_SET

On

CONFIG_ZONE_DMA Support DMA zone

On

CONFIG_ZONE_DMA32 Support DMA32 zone

On
  • Depends on!
Default

CONFIG_ZONE_DEVICE Device memory (pmem, HMM, etc...) hotplug support

On

Device memory hotplug support allows for establishing pmem, or other device driver discovered memory regions, in the memmap. This allows pfn_to_page() lookups of otherwise "device-physical" addresses which is needed for DAX, PCI_P2PDMA, and DEVICE_PRIVATE features among others.

Enabling this option will reduce the entropy of x86 KASLR memory regions. For example - on a 46 bit system, the entropy goes down from 16 bits to 15 bits. The actual reduction in entropy depends on the physical address bits, on processor features, kernel config (5 level page table) and physical memory present on the system.

CONFIG_GET_FREE_REGION

On

CONFIG_DEVICE_PRIVATE Unaddressable device memory (GPU memory, ...)

On

Allows creation of struct pages to represent unaddressable device memory; i.e., memory that is only accessible from the device (or group of devices). You likely also want to select HMM_MIRROR.

CONFIG_VMAP_PFN

On

CONFIG_ARCH_USES_HIGH_VMA_FLAGS

On

CONFIG_ARCH_HAS_PKEYS

On

CONFIG_ARCH_USES_PG_ARCH_2

On

CONFIG_ARCH_USES_PG_ARCH_3

Unknown

CONFIG_VM_EVENT_COUNTERS Enable VM event counters for /proc/vmstat

On

VM event counters are needed for event counts to be shown. This option allows the disabling of the VM event counters on EXPERT systems. /proc/vmstat will only show page counts if VM event counters are disabled.

Default
  • y

CONFIG_PERCPU_STATS Collect percpu memory statistics

On

This feature collects and exposes statistics via debugfs. The information includes global and per chunk statistics, which can be used to help understand percpu memory usage.

CONFIG_GUP_TEST Enable infrastructure for get_user_pages()-related unit tests and benchmarks

On

Provides /sys/kernel/debug/gup_test, which in turn provides a way to make ioctl calls that can launch kernel-based unit tests and benchmarks for the get_user_pages*() and pin_user_pages*() families of API calls.

These include benchmark testing of the _fast variants of get_user_pages*() and pin_user_pages*(), as well as tests of the non-_fast variants.

See tools/testing/selftests/mm/gup.c and tools/mm/gup_bench.c.

GUP_TEST needs to have DEBUG_FS enabled

CONFIG_GUP_GET_PXX_LOW_HIGH

Unknown

CONFIG_DMAPOOL_TEST Enable a module to run time tests on dma_pool

  • Off
  • Module
  • Built in

Provides a test module that will allocate and free many blocks of various sizes and report how long it takes. This is intended to provide a consistent way to measure how changes to the dma_pool_alloc/free routines affect performance.

CONFIG_ARCH_HAS_PTE_SPECIAL

On

CONFIG_MAPPING_DIRTY_HELPERS

On

CONFIG_KMAP_LOCAL

Unknown

CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY

Unknown

CONFIG_MEMFD_CREATE Enable memfd_create() system call

On

CONFIG_SECRETMEM Enable memfd_secret() system call

On

Enable the memfd_secret() system call with the ability to create memory areas visible only in the context of the owning process and not mapped to other processes and other kernel page tables.

CONFIG_ANON_VMA_NAME Anonymous VMA name support

On

Allow naming anonymous virtual memory areas.

This feature allows assigning names to virtual memory areas. Assigned names can be later retrieved from /proc/pid/maps and /proc/pid/smaps and help identifying individual anonymous memory areas. Assigning a name to anonymous virtual memory area might prevent that area from being merged with adjacent virtual memory areas due to the difference in their name.

CONFIG_HAVE_ARCH_USERFAULTFD_WP

On

Arch has userfaultfd write protection support

CONFIG_HAVE_ARCH_USERFAULTFD_MINOR

On

Arch has userfaultfd minor fault support

CONFIG_USERFAULTFD Enable userfaultfd() system call

On

Enable the userfaultfd() system call that allows to intercept and handle page faults in userland.

  • Depends on

If USERFAULTFD

CONFIG_PTE_MARKER_UFFD_WP Userfaultfd write protection support for shmem/hugetlbfs

On

Allows to create marker PTEs for userfaultfd write protection purposes. It is required to enable userfaultfd write protection on file-backed memory types like shmem and hugetlbfs.

If LRU_GEN

CONFIG_LRU_GEN_ENABLED Enable by default

On

This option enables the multi-gen LRU by default.

CONFIG_LRU_GEN_STATS Full stats for debugging

On

Do not enable this option unless you plan to look at historical stats from evicted generations for debugging purpose.

This option has a per-memcg and per-node memory overhead.

CONFIG_IOMMU_MM_DATA

On

CONFIG_EXECMEM

On

CONFIG_NUMA_MEMBLKS

On

CONFIG_NUMA_EMU NUMA emulation

On

Enable NUMA emulation. A flat machine will be split into virtual nodes when booted with "numa=fake=N", where N is the number of nodes. This is only useful for debugging.

CONFIG_GENERIC_ARCH_NUMA

Unknown

Enable support for generic NUMA implementation. Currently, RISC-V and ARM64 use it.

CONFIG_ARCH_HAS_USER_SHADOW_STACK

On

The architecture has hardware support for userspace shadow call stacks (eg, x86 CET, arm64 GCS or RISC-V Zicfiss).

CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE

Unknown
Default
  • n

CONFIG_PT_RECLAIM

On

Try to reclaim empty user page table pages in paths other than munmap and exit_mmap path.

Note: now only empty user PTE page table pages will be reclaimed.

CONFIG_FIND_NORMAL_PAGE

On
Default
  • n

CONFIG_ARCH_HAS_LAZY_MMU_MODE

On

The architecture uses the lazy MMU mode. This allows changes to MMU-related architectural state to be deferred until the mode is exited. See <linux/pgtable.h> for details.

CONFIG_LAZY_MMU_MODE_KUNIT_TEST KUnit tests for the lazy MMU mode

  • Off
  • Module
  • Built in

Enable this option to check that the lazy MMU mode interface behaves as expected. Only tests for the generic interface are included (not architecture-specific behaviours).

If unsure, say N.

CONFIG_ARCH_HAS_CHECK_WX

On

CONFIG_CHECK_WX Warn on W+X mappings at boot

On

Generate a warning if any W+X mappings are found at boot.

This is useful for discovering cases where the kernel is leaving W+X mappings after applying NX, as such mappings are a security risk.

Look for a message in dmesg output like this:

  <arch>/mm: Checked W+X mappings: passed, no W+X pages found.

or like this, if the check failed:

  <arch>/mm: Checked W+X mappings: failed, <N> W+X pages found.

Note that even if the check fails, your kernel is possibly still fine, as W+X mappings are not a security hole in themselves, what they do is that they make the exploitation of other unfixed kernel bugs easier.

There is no runtime or memory usage effect of this option once the kernel has booted up - it's a one time check.

If in doubt, say "Y".

CONFIG_ARCH_HAS_PTDUMP

On

CONFIG_PTDUMP

On
Includemm/damon/Kconfig Open file
End of Memory Management options