Skip to content
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

libvirt_numa: Fix parsing of continuous numa nodes #3804

Merged

Conversation

hs0210
Copy link
Contributor

@hs0210 hs0210 commented Nov 24, 2023

Fix parsing of continuous numa nodes.

Parsing result without the patch:

21:35:15 DEBUG| numa_nodeset='x-y', node_list=[0, 1, 2, 3]
21:35:15 DEBUG| Parse output for numa nodeset: '0-1'

Testing result without the patch:

FAIL 1-type_specific.io-github-autotest-libvirt.guest_numa_node_tuning.auto_memory_nodeset_placement.without_iothread.nodeset_defined.mem_mode_interleave.vcpu_auto -> TestFail: Expect cpuset.mems=0-1, but found 0-3

Parsing result with the patch:

22:48:25 DEBUG| numa_nodeset='x-y', node_list=[0, 1, 2, 3]
22:48:25 DEBUG| Parse output for numa nodeset: '0-3'

Testing result with the patch:

PASS 1-type_specific.io-github-autotest-libvirt.guest_numa_node_tuning.auto_memory_nodeset_placement.without_iothread.nodeset_defined.mem_mode_interleave.vcpu_auto

@hs0210
Copy link
Contributor Author

hs0210 commented Nov 24, 2023

@dzhengfy Could you please take a look?

If node list is [0, 2, 3, 5], return 1
If node list is [1, 4, 8], return -1
If node list is [0, 1, 2, 3], return "0-3"
If node list is [0, 2, 3, 4], return "-1"
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel we should return "2-4" if node list is [0, 2, 3, 4]

@hs0210 hs0210 force-pushed the parse_numa_nodeset_to_str branch 2 times, most recently from fca8cb2 to c0a225c Compare January 29, 2024 08:13
@hs0210
Copy link
Contributor Author

hs0210 commented Jan 29, 2024

@dzhengfy I have written a new func to convert all online numa nodes to a string, PTAL. The CI failure should be anther issue.

@dzhengfy dzhengfy self-requested a review March 1, 2024 10:34
node_ranges.append(f"{start_node}-{end_node}")

converted_numa_nodes = ",".join(node_ranges)
LOG.debug("Convert output for all online numa nodes: '%s'" % converted_numa_nodes)
Copy link
Contributor

Choose a reason for hiding this comment

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

% -> ','

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@dzhengfy
Copy link
Contributor

dzhengfy commented Mar 1, 2024

Others LGTM

@hs0210 hs0210 force-pushed the parse_numa_nodeset_to_str branch from c0a225c to ce4caa6 Compare March 4, 2024 08:45
In some cases, we need a string representation of all online numa nodes.

Signed-off-by: Hu Shuai <[email protected]>
@dzhengfy dzhengfy merged commit 34bd93e into avocado-framework:master Mar 5, 2024
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants