Page MenuHomeFreeBSD

bhyve: Add support for specifying VM NUMA configuration
Needs ReviewPublic

Authored by bnovkov on Mar 30 2024, 4:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 3, 2:22 PM
Unknown Object (File)
Mon, May 27, 2:09 AM
Unknown Object (File)
Mon, May 27, 2:09 AM
Unknown Object (File)
Sun, May 19, 5:58 AM
Unknown Object (File)
Mon, May 13, 7:37 AM
Unknown Object (File)
Apr 30 2024, 1:48 PM
Unknown Object (File)
Apr 26 2024, 4:35 AM
Unknown Object (File)
Apr 4 2024, 7:53 PM
Subscribers

Details

Reviewers
jhb
markj
corvink
Group Reviewers
bhyve
Summary

This patch adds basic support for adding NUMA domains to a bhyve VM.

The user can define a NUMA domain using the -n flag, which expects a domain id, a CPU set, and memory size for each NUMA domain.
After parsing the node configurations, we use the interfaces added in previous patches to set the NUMA configuration for the virtual machine.
Afterwards, we use the configuration to build the ACPI Static Resource Affinity Table (SRAT) which is used to pass NUMA information to the guest.

Test Plan

I've tested the patch by booting a 10GB FreeBSD VM with two domains: -n id=0,size=5G,cpus=0-4 -n id=1,size=5G,cpus=5-9.
I can confirm that FreeBSD detects the specified domains properly.

bojan@dev /u/h/bojan> sysctl vm.phys_segs
vm.phys_segs: 
SEGMENT 0:

start:     0x1000
end:       0xa0000
domain:    0
free list: 0xffffffff81c073f0
...
SEGMENT 10:

start:     0x180000000
end:       0x2b6124000
domain:    1
free list: 0xffffffff81c078d0
...

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped