← 返回命令列表

Linux command

mbind 命令

文本

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Set NUMA policy for memory range (C code)

mbind([addr], [length], MPOL_BIND, [&nodemask], [maxnode], 0)

Bind memory to specific node

mbind([ptr], [size], MPOL_BIND, [&mask], [maxnode], MPOL_MF_MOVE)

Interleave memory across nodes

mbind([addr], [len], MPOL_INTERLEAVE, [&nodemask], [maxnode], 0)

说明

mbind is a system call that sets the NUMA memory policy for a specified memory range. It controls which NUMA nodes are used for memory allocation within that range. This is used for performance optimization on NUMA systems by controlling memory locality.

参数

addr
Starting address of memory range.
len
Length of memory range.
mode
MPOL_DEFAULT, MPOL_BIND, MPOL_INTERLEAVE, MPOL_PREFERRED.
nodemask
Bitmask of NUMA nodes.
maxnode
Maximum node number + 1.
flags
MPOL_MF_STRICT, MPOL_MF_MOVE, MPOL_MF_MOVE_ALL.

FAQ

What is the mbind command used for?

mbind is a system call that sets the NUMA memory policy for a specified memory range. It controls which NUMA nodes are used for memory allocation within that range. This is used for performance optimization on NUMA systems by controlling memory locality.

How do I run a basic mbind example?

Run `mbind([addr], [length], MPOL_BIND, [&nodemask], [maxnode], 0)` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does addr do in mbind?

Starting address of memory range.