Numa policy hit/miss statistics (翻译 by chatgpt)

原文: https://www.kernel.org/doc/html/latest/admin-guide/numastat.html

/sys/devices/system/node/node*/numastat

All units are pages. Hugepages have separate counters.

The numa_hit, numa_miss and numa_foreign counters reflect how well processes are able to allocate memory from nodes they prefer. If they succeed, numa_hit is incremented on the preferred node, otherwise numa_foreign is incremented on the preferred node and numa_miss on the node where allocation succeeded.
numa_hit、numa_miss 和 numa_foreign 计数器反映了进程能够从其首选节点分配内存的情况。如果成功,numa_hit 在首选节点上增加,否则在首选节点上增加 numa_foreign,而在分配成功的节点上增加 numa_miss。

Usually preferred node is the one local to the CPU where the process executes, but restrictions such as mempolicies can change that, so there are also two counters based on CPU local node. local_node is similar to numa_hit and is incremented on allocation from a node by CPU on the same node. other_node is similar to numa_miss and is incremented on the node where allocation succeeds from a CPU from a different node. Note there is no counter analogical to numa_foreign.
通常情况下,首选节点是进程执行的 CPU 本地节点,但是诸如 mempolicies 之类的限制可能会改变这一点,因此还有基于 CPU 本地节点的两个计数器。local_node 类似于 numa_hit,表示在同一节点的 CPU 上从节点分配内存时增加。other_node 类似于 numa_miss,表示在来自不同节点的 CPU 上从节点分配成功时增加。需要注意的是,没有与 numa_foreign 类似的计数器。

In more detail:
更详细的解释如下:

numa_hit A process wanted to allocate memory from this node, and succeeded. 进程希望从该节点分配内存,并成功分配。
numa_miss A process wanted to allocate memory from another node, but ended up with memory from this node. 进程希望从其他节点分配内存,但最终从该节点获得内存。
numa_foreign A process wanted to allocate on this node, but ended up with memory from another node. 进程希望在该节点上分配内存,但最终从其他节点获得内存。
local_node A process ran on this node's CPU, and got memory from this node. 进程在该节点的 CPU 上运行,并从该节点获得内存。
other_node A process ran on a different node's CPU and got memory from this node. 进程在不同节点的 CPU 上运行,并从该节点获得内存。
interleave_hit Interleaving wanted to allocate from this node and succeeded. 交错内存分配希望从该节点分配内存,并成功分配。

For easier reading you can use the numastat utility from the numactl package (http://oss.sgi.com/projects/libnuma/). Note that it only works well right now on machines with a small number of CPUs.
为了更方便地阅读,您可以使用 numactl 软件包中的 numastat 实用程序 (http://oss.sgi.com/projects/libnuma/) 。需要注意的是,目前该实用程序仅在具有少量 CPU 的机器上运行良好。

Note that on systems with memoryless nodes (where a node has CPUs but no memory) the numa_hit, numa_miss and numa_foreign statistics can be skewed heavily. In the current kernel implementation, if a process prefers a memoryless node (i.e. because it is running on one of its local CPU), the implementation actually treats one of the nearest nodes with memory as the preferred node. As a result, such allocation will not increase the numa_foreign counter on the memoryless node, and will skew the numa_hit, numa_miss and numa_foreign statistics of the nearest node.
需要注意的是,在存在无内存节点的系统上(即节点具有 CPU 但没有内存),numa_hit、numa_miss 和 numa_foreign 统计数据可能会严重偏斜。在当前的内核实现中,如果进程首选无内存节点(例如因为它正在运行在其本地 CPU 上),实际上会将最近的具有内存的节点之一视为首选节点。因此,这样的分配不会增加无内存节点上的 numa_foreign 计数器,并且会使最近节点的 numa_hit、numa_miss 和 numa_foreign 统计数据产生偏差。

posted @ 2023-11-30 16:04  dolinux  阅读(57)  评论(0)    收藏  举报