numa_emulation(9)
π« numa_emulation (9) β from the Kernel API Manual, bestie π«
okay so you're about to fake some NUMA nodes and honestly? iconic behaviour. this is numa_emulation, and it lives in the kernel API manual, section 9, and it's here to let you cosplay as having more NUMA nodes than you actually do. slay π
β¨ SYNOPSIS β¨
void numa_emulation (struct numa_meminfo *numa_meminfo , int
numa_dist_cnt );
like, that's the whole signature. two things in, nothing out. void return, so if it goes sideways you find out some other way. π
π ARGUMENTS π
numa_meminfoβ the NUMA configuration you want massaged. yes, the manpage literally says "massage". it's getting a whole glow-up applied to it π«Άnuma_dist_cntβ the size of the physical NUMA distance table. this is how the function figures out how big the physical distance table actually is.
πΈ DESCRIPTION πΈ
okay so the vibe here is: this emulates NUMA nodes based on the numa=fake kernel parameter. that's the whole mission. π
numa_meminfo holds the physical memory configuration, and on success it gets modified in place to reflect the emulated configuration. numa_dist_cnt is there to determine the size of the physical distance table.
on success, these modifications happen β and bestie, there are four of them, so stay with me:
numa_meminfois updated so it reflects the emulated nodes. π¦__apicid_to_node[]is updated so that APIC IDs are mapped to the emulated nodes.- the NUMA distance table gets rebuilt to represent distances between the emulated nodes. these distances are determined by considering how the emulated nodes are mapped to physical nodes, and they match the actual distances. lowkey clever.
emu_nid_to_phys[]reflects how the emulated nodes are mapped to physical nodes. this one is used bynuma_add_cpuandnuma_remove_cpu, so it's kind of a big deal.
ngl if emulation is not enabled, or if it simply fails, emu_nid_to_phys[] gets filled with the identity mapping and no other modification is made. that's it. no other changes. the whole thing just quietly does the identity-mapping thing and calls it a day. π
π SEE ALSO π
- Kernel file
./mm/numa_emulation.cβ go read the source, it's giving main character energy fr fr π₯
πΈ okay that's the page, bestie! this one came from ./mm, and it's dated October 2026 β so yeah, technically from the future, and honestly? obsessed. periodt. ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms