将默认 numa 策略设置为系统范围内的“交错”

将默认 numa 策略设置为系统范围内的“交错”

我知道可以使用 将 numa 模式设置为特定进程的“交错”(参见下面的 NB)numactrl --interleave,但我想知道是否可以将其设为系统范围的默认设置(即更改“系统策略”)。例如,是否有内核启动标志来实现这一点?

注意:这里我指的是内核行为,即在 NUMA 节点间交错分配的页面,而不是 BIOS 级别的内存控制器行为设置,即在 NUMA 节点间交错缓存行。

答案1

如果使用 RHEL/CentOS/Fedora,我建议使用努马德守护进程。(Red Hat 付费墙链接)。

虽然我不太需要这个numactl --interleave指令,但你似乎已经确定你的工作量需要它。你能解释一下为什么会这样吗,以便提供更好的背景信息?

编辑:

似乎大多数建议明确numactl定义的应用程序要么做出libnuma 库调用numactl纳入包装脚本

对于numad方面,有一个配置选项可以在命令行或/etc/numad.conf...中指定。

-K <0|1>
   This option controls whether numad keeps interleaved  memory  spread  across  NUMA  nodes,  or
   attempts to merge interleaved memory to local NUMA nodes.  The default is to merge interleaved
   memory.  This is the appropriate setting to localize processes in a  subset  of  the  system’s
   NUMA  nodes.   If  you  are running a large, single-instance application that allocates inter-
   leaved memory because the workload will have continuous unpredictable memory  access  patterns
   (e.g. a large in-memory database), you might get better results by specifying -K 1 to instruct
   numad to keep interleaved memory distributed.

有人说,尝试类似 的方法numad -K 1 -u X(其中 X 是 100 x 核心数)可能会有所帮助。试试看。

另请参阅HP ProLiant 有关 Linux 和 NUMA 的白皮书。

相关内容