-
Notifications
You must be signed in to change notification settings - Fork 188
Simulate numa nodes #4428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Simulate numa nodes #4428
Conversation
|
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces the capability to simulate NUMA nodes in QEMU for external tests. The changes involve adding a NumaNodes option and plumbing it through various layers of the test harness and platform configuration. The core logic for generating QEMU arguments for NUMA is in mantle/platform/qemu.go.
I've identified a couple of issues in the implementation within mantle/platform/qemu.go that could lead to incorrect resource allocation for the simulated NUMA nodes. My review includes suggestions to fix these bugs.
mantle/kola/register/register.go
Outdated
| Timeout time.Duration // the duration for which a test will be allowed to run | ||
| RequiredTag string // if specified, test is filtered by default unless tag is provided -- defaults to none | ||
| Description string // test description | ||
| NumaNodes int // Number of numa nodes to simulate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this an on/off flag where we hardcode 2 NUMA nodes as I don't think we'll test with more than that and maybe that should simplify the code a bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this remove the for loop in baseNumaQemuArgs function, but most of the checks would still be quite similar.
Would it be useful to also allow the numaNodes flag with the cosa run command for debugging? If so, allowing an integer may be nice.
If making it a boolean would keep it simpler, and the above is not worth implementing, then I am happy to change it to use a boolean flag.
ravanelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, it is looking good, let's squash the commits and follow the suggestion to simply it with using on/off with 2 NUMA nodes
mantle/kola/harness.go
Outdated
| Description string `json:"description" yaml:"description"` | ||
| } | ||
|
|
||
| // FIXME: This is not decoding the numa nodes flag properly... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's squash the commits, there are a lot of commits for the same feature and context, for example we have this one adding this comment and another one removing the same thing.
| } | ||
|
|
||
| builder.NumaNodes = options.NumaNodes | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra line
mantle/platform/qemu.go
Outdated
| // Number of numa nodes to simulate, if 0 then no numa eumulation will take place. | ||
| // | ||
| // The machines memory and processors will be divided evenly between all the numa nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Number of numa nodes to simulate, if 0 then no numa eumulation will take place. | |
| // | |
| // The machines memory and processors will be divided evenly between all the numa nodes. | |
| // Number of NUMA nodes to simulate (0 disables NUMA emulation). | |
| // Memory and CPUs are evenly split across nodes. |
mantle/platform/qemu.go
Outdated
| kvm = false | ||
| } | ||
| machineArg += "," + accel | ||
| func platformQemuArgs(arch, machineArg string, kvm bool) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did a split in this function and also created baseNumaQemuArgs that shares a lot of the same code, let's try to merge the duplication
mantle/platform/qemu.go
Outdated
| memoryPerNode := memoryMiB / numaNodes | ||
| cpusPerNode := cpus / numaNodes | ||
|
|
||
| for nodeId := range numaNodes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for keeping it simple, with on/off with a fixed number of 2
52601f4 to
774b30c
Compare
|
/test all |
774b30c to
5590322
Compare
New boolean flag "numaNodes" will simulate two NUMA nodes. They will divide the memory and cpus between them.
5590322 to
aafd091
Compare
Add an option for external tests to be executed by a machine with multiple numa nodes.