In the 4.19.91-22.al7.x86_64 and later kernel versions of Alibaba Cloud Linux 2 operating systems, the statistical Active(anon) and Inactive(anon) statuses of anonymous pages in the /proc/meminfo file 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 status 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) statuses of data in the /proc/meminfo file. The following items list the updates 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 item in the 4.19.91-22.al7.x86_64 and later kernel versions of Alibaba Cloud Linux 2. The statistical Active (anon) and Inactive (anon) statuses 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 the memory is insufficient.

By default, in the kernel version of 4.19.91-22.al7.x86_64 or later 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. Therefore, if you use Active(anon) and Inactive(anon) in the /proc/meminfo file to indicate the statuses of anonymous pages, you need to adjust the configuration based on the change.

Impact of the change and recommendations

Due to the statistical Active(anon) and Inactive(anon) status change of anonymous pages, the Active(anon) and Inactive(anon) data queried by an application before this change are inconsistent with the data queried after the change.

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