All Products
Search
Document Center

Alibaba Cloud Linux:Statistical state change of anonymous pages in the /proc/meminfo file

Last Updated:Oct 10, 2023

The statistical Active(anon) and Inactive(anon) states of anonymous pages in the /proc/meminfo file of Alibaba Cloud Linux 2 starting with kernel version 4.19.91-22.al7 and Alibaba Cloud Linux 3 are changed. If your application uses these statistics, this change causes inconsistency between the data that is queried before the change and the data after the change. This topic describes the change in the statistical states of anonymous pages in the /proc/meminfo file.

Reason for the change

The reclaiming of anonymous pages in the latest kernel version is optimized in the Linux kernel community. The default storage location of anonymous pages is changed from the active least-recently used (LRU) list to the inactive LRU list. This affects the statistical Active(anon) and Inactive(anon) states of data in the /proc/meminfo file. The following updates are made in the community:

  • New version used in the community: Linux Kernel 5.10

  • Commit submitted to the community: b518154e59aab3ad0780a169c5cc84bd4ee4357e

Alibaba Cloud has incorporated this optimization in Alibaba Cloud Linux 2 starting with kernel version 4.19.91-22.al7.x86_64 and Alibaba Cloud Linux 3. The statistical Active (anon) and Inactive (anon) states of anonymous pages in the /proc/meminfo file will change.

Note

You can run the uname -r command in operating systems to obtain kernel version information.

Details of the change

By default, in the kernel versions earlier than 4.19.91-22.al7.x86_64 of Alibaba Cloud Linux 2, the anonymous pages applied by applications are counted as Active(anon) in the /proc/meminfo file, and are counted as Inactive(anon) only when memory is insufficient.

By default, in 4.19.91-22.al7.x86_64 or later kernel versions of Alibaba Cloud Linux 2, the anonymous pages applied by applications are counted as Inactive(anon) in the /proc/meminfo file, and are counted as Active(anon) only after the anonymous pages are accessed. If you use Active(anon) and Inactive(anon) in the /proc/meminfo file to indicate the states of anonymous pages, you need to adjust the configurations based on the change.

Impact of the change and recommendations

The Active(anon) and Inactive(anon) data queried by an application before this change is inconsistent with the data queried after the change due to the statistical Active(anon) and Inactive(anon) state change of anonymous pages.

We recommend that you adjust the configurations of your applications based on the latest statistics of anonymous pages in your Alibaba Cloud Linux operating systems.