LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mbind

system call that sets the NUMA memory policy for a specified memory range

TLDR

Set NUMA policy for memory range (C code)
$ mbind([addr], [length], MPOL_BIND, [&nodemask], [maxnode], 0)
copy
Bind memory to specific node
$ mbind([ptr], [size], MPOL_BIND, [&mask], [maxnode], MPOL_MF_MOVE)
copy
Interleave memory across nodes
$ mbind([addr], [len], MPOL_INTERLEAVE, [&nodemask], [maxnode], 0)
copy

SYNOPSIS

long mbind(void *addr, unsigned long len, int mode, const unsigned long *nodemask, unsigned long maxnode, unsigned flags)

DESCRIPTION

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.

PARAMETERS

addr

Starting address of memory range.
len
Length of memory range.
mode
MPOLDEFAULT, MPOLBIND, MPOLINTERLEAVE, MPOLPREFERRED.
nodemask
Bitmask of NUMA nodes.
maxnode
Maximum node number + 1.
flags
MPOLMFSTRICT, MPOLMFMOVE, MPOLMFMOVE_ALL.

POLICIES

$ MPOL_DEFAULT    - Use process default
MPOL_BIND       - Strict binding to nodes
MPOL_INTERLEAVE - Round-robin across nodes
MPOL_PREFERRED  - Prefer specified node
copy

CAVEATS

Requires NUMA hardware. Only affects future allocations unless flags specify migration. Privileged flags may require CAPSYSNICE.

HISTORY

mbind was added to Linux kernel 2.6.7 as part of NUMA memory policy support, developed primarily by Andi Kleen at SUSE.

SEE ALSO

numactl(8), numastat(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid