Detailed analysis of memory management related configuration items in the Linux kernel 1

Based on kernel 6.1.0, this article analyzes in detail the sub-configuration items under the "Memory Management options" item in "Linux/x86 6.1.0 Kernel Configuration" (as shown in the figure below).

一、Support for paging of anonymous memory (swap)

This option was previously located in "General Setup" and was later changed to "Memory Management options". This option will enable your kernel to support virtual memory, that is, to make your computer seem to have more memory space than actual memory for executing large programs. This item only includes selected (*) that is Y and unselected () that is N, the default is selected.

The "Support for paging of anonymous memory (swap)" item is expanded, as shown in the following figure:

1. Compressed cache for swap pages (compressed cache for swap pages)

The corresponding configuration variable is: CONFIG_ZSWAP.

This item also has only two states: selected and unselected. The options below appear only when selected, otherwise just this:

 The kernel source code of this item is explained in detail as:

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. 

Lightweight compressed cache of swap pages. It takes pages that are being swapped out and tries to compact them into a dynamically allocated pool of RAM-based memory. This can significantly reduce I/O (operations) on the swap device and also improve workload performance where decompressing from RAM is faster than reading from swap.

2. Enable the compressed cache for swap pages by default (by default, enable (enable) the compressed cache for swap pages)

The corresponding configuration variable is: CONFIG_ZSWAP__DEFAULT_ON.

This item also has only two states: selected and unselected. Default is unchecked.

The kernel source code of this item is explained in detail as:

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.

If checked, swap page compression caching will be enabled at boot (startup); otherwise it will be disabled.

Selections made here can be overridden by using the kernel command line "zswap.enabled=" option.

Other options will continue to be introduced in subsequent articles.

Guess you like

Origin blog.csdn.net/phmatthaus/article/details/131121552