Skip to content

Conversation

@angelcerveraroldan
Copy link
Contributor

Add an option for external tests to be executed by a machine with multiple numa nodes.

@openshift-ci
Copy link

openshift-ci bot commented Feb 3, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@ravanelli ravanelli left a 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

Description string `json:"description" yaml:"description"`
}

// FIXME: This is not decoding the numa nodes flag properly...
Copy link
Member

@ravanelli ravanelli Feb 11, 2026

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra line

Comment on lines 496 to 498
// 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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.

kvm = false
}
machineArg += "," + accel
func platformQemuArgs(arch, machineArg string, kvm bool) ([]string, error) {
Copy link
Member

@ravanelli ravanelli Feb 11, 2026

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

memoryPerNode := memoryMiB / numaNodes
cpusPerNode := cpus / numaNodes

for nodeId := range numaNodes {
Copy link
Member

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

@angelcerveraroldan
Copy link
Contributor Author

/test all

New boolean flag "numaNodes" will simulate two NUMA nodes. They will
divide the memory and cpus between them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants