When Linux kernel runs on NUMA, each NUMA node has partially separate memory management. There is echo '?' > /proc/sysrq-trigger
function "Will dump current memory info to your console." of SysRq (implemented as sysrq_handle_showmem
and show_mem
) to get basic memory statistics for every NUMA node to system console, dmesg and system kernel log.
As I understand, there is data printed on memory usage by kernel's disk cache (page cache) for every NUMA node, probably from active_file:%lu inactive_file:%lu
code of show_free_areas
. (The line cached from free
tool output?)
I want to monitor disk cache usage over numa nodes for long amounts of time with frequent updates; and I want not to fill entire console and dmesg with outputs from SysRq-m
. I plan to find how multi-process or multi-threaded programs (not bound to core or node with affinity) interacts with pagecache pages placed in other node memory.
Is this information (pagecache memory usage per NUMA node) published for program access without using sysrq, by reading and parsing some special files in /proc
or in /sys
? Or is it needed to write new kernel module for this?
free
tool uses /proc/meminfo
to print cache Memory used by the page cache and slabs for entire system; not for every NUMA node. I was unable find per-numa memory stats in http://man7.org/linux/man-pages/man5/proc.5.html man page of proc 5.
There is numastat: https://www.kernel.org/doc/Documentation/numastat.txt but it has no pagecache memory statistics; as I understand it says only about cross-numa page allocation counts, which can be useless when processes are often move between NUMA nodes.