Linux 6.16 Exposes Statistics for NUMA Task Migration and Swapping

1 day ago 3

LINUX KERNEL

In addition to the memory management "MM" changes merged last week that included features like Kernel HandOver "KHO" support, a second batch of MM changes were submitted and merged this week for Linux 6.16.

Notable with the secondary set of memory management updates is exposing more visibility into the NUMA balancer's task migration activity.

Intel engineer Chen Yu submitted the code for exposing statistics of NUMA task migration and swapping via sysfs and procfs for helping server administrators better analyze NUMA balancing activity on Linux servers.

Intel Xeon 6 Granite Rapids server

Yu explained in the patch adding these new NUMA balance task statistics:

"On systems with NUMA balancing enabled, it has been found that tracking task activities resulting from NUMA balancing is beneficial. NUMA balancing employs two mechanisms for task migration: one is to migrate a task to an idle CPU within its preferred node, and the other is to swap tasks located on different nodes when they are on each other's preferred nodes.

The kernel already provides NUMA page migration statistics in /sys/fs/cgroup/mytest/memory.stat and /proc/{PID}/sched. However, it lacks statistics regarding task migration and swapping. Therefore, relevant counts for task migration and swapping should be added.

The following two new fields:

numa_task_migrated
numa_task_swapped

will be shown in /sys/fs/cgroup/{GROUP}/memory.stat, /proc/{PID}/sched and /proc/vmstat

Introducing both per-task and per-memory cgroup (memcg) NUMA balancing statistics facilitates a rapid evaluation of the performance and resource utilization of the target workload. For instance, users can first identify the container with high NUMA balancing activity and then further pinpoint a specific task within that group, and subsequently adjust the memory policy for that task. In short, although it is possible to iterate through /proc/$pid/sched to locate the problematic task, the introduction of aggregated NUMA balancing activity for tasks within each memcg can assist users in identifying the task more efficiently through a divide-and-conquer approach."

The NUMA task migration and swap statistics are now exposed with the latest Linux 6.16 development code. More details for those interested via this MM pull.

Read Entire Article