Page MenuHomeFreeBSD

libvmmapi: Add support for setting up and configuring guest NUMA domains
Needs ReviewPublic

Authored by bnovkov on Mar 30 2024, 4:33 PM.
Tags
None
Referenced Files
F122063476: D44566.diff
Tue, Jul 1, 10:42 PM
F122057879: D44566.id.diff
Tue, Jul 1, 9:16 PM
F122019493: D44566.id138715.diff
Tue, Jul 1, 12:28 PM
F122015802: D44566.id143453.diff
Tue, Jul 1, 11:40 AM
F121989338: D44566.id143123.diff
Tue, Jul 1, 5:55 AM
F121988925: D44566.id143123.diff
Tue, Jul 1, 5:50 AM
Unknown Object (File)
Mon, Jun 30, 3:16 PM
Unknown Object (File)
Sun, Jun 29, 6:07 AM
Subscribers

Details

Reviewers
jhb
corvink
markj
Group Reviewers
bhyve
Summary

This patch reworks libvmmapi to provide support for emulating NUMA domains in guests.

More specifically, it reworks vm_setup_memory to setup system memory segments for each guest NUMA domain, adds per-domain CPU affinity tracking to struct vm_ctx, and adds two new routines for fetching and setting a domain's CPU set.

An emulated NUMA domain is described by a struct vmdom in vmmapi.h. Aside from its size in bytes, each domain can be configured to use a specific domainset(9) policy and domain mask.
vm_setup_memory now takes two additional arguments - an array of struct vmdoms and the array's size. It then proceeds to set up a memory segment for each specified domain using the existing memory mapping scheme. If no domain info is passed, the memory setup falls back to the original, non-NUMA behaviour.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bnovkov retitled this revision from libvmmapi: Add interfaces for setting and getting VM NUMA configuration to libvmmapi: Add support for setting up and configuring guest NUMA domains.
bnovkov edited the summary of this revision. (Show Details)

Update patch and summary.

bnovkov edited the summary of this revision. (Show Details)

Update patch with support for handling arbitrary domainset(9) policies.

Fix an issue when mapping segments larger than VM_LOWMEM_LIMIT.

lib/libvmmapi/amd64/vmmapi_machdep.c
31 ↗(On Diff #157461)

This should be sorted after types.h (which is special) and before ioctl.h.

lib/libvmmapi/vmmapi.c
463
1263

This function does nothing but update libvmm internal state, based on the already-created memsegs. This state is only used to implement vm_get_domain_cpus(), which I think is only used when building the SRAT. What's the purposes of keeping track of these cpusets here? Isn't it just duplicating state that's already in the kernel?