接前一篇文章:Linux内核中内存管理相关配置项的详细解析12
二十八、Enable VM event counters for /proc/vmstat
对应配置变量为:CONFIG_VM_EVENT_COUNTERS。
此项只有选中和不选中两种状态,默认为选中。
此项的内核源码详细解释为:
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.
需要VM事件计数器才能显示事件计数。此选项允许禁用EXPERT系统上的VM事件计数器。/proc/vmstat将在禁用VM事件计数器的情况下仅显示页面计数。
扫描二维码关注公众号,回复: 15373447 查看本文章
二十九、Collect percpu memory statistics
对应配置变量为:CONFIG_PERCPU_STATS。
此项只有选中和不选中两种状态,默认为不选中。
此项的内核源码详细解释为:
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.
此功能通过debugfs收集并公开统计信息。该信息包括全局和每块统计,其可用于帮助理解percpu存储器的使用。
三十、Enable infrastructure for get_user_pages()-related unit tests
对应配置变量为:CONFIG_GUP_TEST。
此项只有选中和不选中两种状态,默认为不选中。
此项的内核源码详细解释为:
Provides /sys/kernel/debug/gup_test, which in turn provides a way
to make ioctl calls that can launch kernel-based unit tests for
the get_user_pages*() and pin_user_pages*() family of API calls.
These tests include benchmark testing of the _fast variants of
get_user_pages*() and pin_user_pages*(), as well as smoke tests of
the non-_fast variants.
There is also a sub-test that allows running dump_page() on any
of up to eight pages (selected by command line args) within the
range of user-space addresses. These pages are either pinned via
pin_user_pages*(), or pinned via get_user_pages*(), as specified
by other command line arguments.
See tools/testing/selftests/vm/gup_test.c
提供/sys/kernel/debug/gup_test,其反过来提供了一种进行ioctl调用的方法,该方法可以为get_user_pages*()和pin_user_page*()API调用族启动基于内核的单元测试。
这些测试包括get_user_pages*()和pin_user_pages*()快速变体的基准测试,以及非快速变体的烟雾测试。
还有一个子测试,允许在用户空间地址范围内的多达8个页面(由命令行参数选择)中的任何一个页面上运行dump_page()。这些页面要么通过pin_user_pages*()锁定,要么通过get_user_pages*()锁定,由其它命令行参数指定。
参阅tools/testing/selftests/vm/gup_test.c。