NUMA(4)
β¨ NUMA(4) β the kernel interfaces manual, bestie edition β¨
okay so you opened the manual page for NUMA (that's section 4, kernel interfaces, we love a kernel-adjacent moment π
). it's literally called Non-Uniform Memory Access and it's giving big "your RAM is not all the same distance away" energy. let's get into it π¦
πΈ NAME πΈ
NUMA β Non-Uniform Memory Access
π SYNOPSIS π
options MAXMEMDOM
options NUMA
π DESCRIPTION π
Non-Uniform Memory Access is a computer architecture design that involves unequal costs between processors, memory and IO devices in a given system. not all hops are the same length, and that's the whole vibe.
In a NUMA architecture, the latency to access specific memory or IO devices depends upon which processor the memory or device is attached to. Accessing memory local to a processor is faster than accessing memory that is connected to one of the other processors. so like, staying in your own lane is genuinely faster, no cap.
FreeBSD implements NUMA-aware memory allocation policies. By default it attempts to ensure that allocations are balanced across each domain. Users may override the default domain selection policy using cpuset(1).
NUMA support is enabled when the NUMA option is specified in the kernel configuration file. Each platform defines the MAXMEMDOM constant, which specifies the maximum number of supported NUMA domains. This constant may be specified in the kernel configuration file. NUMA support can be disabled at boot time by setting the vm.numa.disabled tunable to 1. Other values for this tunable are currently ignored. π
Thread and process NUMA policies are controlled with the cpuset_getdomain(2) and cpuset_setdomain(2) syscalls. The cpuset(1) tool is available for starting processes with a non-default policy, or to change the policy of an existing thread or process. icon behaviour honestly π
Systems with non-uniform access to I/O devices may mark those devices with the local VM domain identifier. Drivers can find out their local domain information by calling bus_get_domain(9).
π MIB Variables π
The operation of NUMA is controlled and exposes information with these sysctl(8) MIB variables:
vm.ndomainsβ The number of VM domains which have been detected. she's counting πvm.phys_localityβ A table indicating the relative cost of each VM domain to each other. A value of10indicates equal cost. A value of-1means the locality map is not available or no locality information is available. so-1is the "we don't know her" value πvm.phys_segsβ The map of physical memory, grouped by VM domain.
π§ IMPLEMENTATION NOTES π§
The current NUMA implementation is VM-focused. The hardware NUMA domains are mapped into a contiguous, non-sparse VM domain space, starting from 0. Thus, VM domain information (for example, the domain identifier) is not necessarily the same as is found in the hardware specific information. do not assume they're twins, they're just cousins fr fr.
Policy information is available in both struct thread and struct proc.
π₯ SEE ALSO π₯
cpuset(1)cpuset_getaffinity(2)cpuset_setaffinity(2)bus_get_domain(9)
π HISTORY π
NUMA first appeared in FreeBSD 9.0 as a first-touch allocation policy with a fail-over to round-robin allocation and was not configurable. It was then modified in FreeBSD 10.0 to implement a round-robin allocation policy and was also not configurable. the character development was slow at first ngl π
The numa_getaffinity(2) and numa_setaffinity(2) syscalls and the numactl(1) tool first appeared in FreeBSD 11.0 and were removed in FreeBSD 12.0. The current implementation appeared in FreeBSD 12.0. gone but not forgotten, we hardly knew ye π«Ά
π AUTHORS π
This manual page written by Adrian Chadd <adrian@FreeBSD.org>.
β NOTES β
No statistics are kept to indicate how often NUMA allocation policies succeed or fail. so like, we're flying blind but make it β¨architecturalβ¨
and that's the whole page, bestie β this one came from Debian, dated October 22, 2018 π go forth and balance your domains, you absolute icon πΈπ¦π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2015 Adrian Chadd <adrian@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms