Skip to content

Don't use '-A' in network.py on non-numa systems (BugFix)#711

Merged
Hook25 merged 2 commits intomainfrom
fix-cpu-affinity-network
Jan 7, 2024
Merged

Don't use '-A' in network.py on non-numa systems (BugFix)#711
Hook25 merged 2 commits intomainfrom
fix-cpu-affinity-network

Conversation

@rodwsmith
Copy link
Copy Markdown
Collaborator

@rodwsmith rodwsmith commented Sep 8, 2023

Description

This PR fixes bug #570, which can cause the CPU load to spike if the CPU affinity is set incorrectly on systems that don't support NUMA features.

The fix involves identifying systems that lack NUMA support and not passing the -A {nodes} option to iperf3 on such systems.

Resolved issues

Resolves bug #570

Jira card: https://warthogs.atlassian.net/browse/SERVCERT-1183

Documentation

No documentation changes required.

Tests

Tested on lloobee (my own ARM64-based development system), which exhibited the bug. The new version drops the CPU load from 90%+ to about 35-40%, and increases the throughput by about 5% (from 88% to 93%, give or take a percent or two).

I've also tested on two servers in the Server Certification pool, torchtusk and whomp, to be sure the script doesn't create problems on systems that DO support NUMA. No unexpected problems arose. The change should result in exactly the same iperf3 command being used on such systems as the previous version of the script. Such systems were unaffected by the bug to begin with.

@rodwsmith rodwsmith requested a review from bladernr September 8, 2023 19:16
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cac5044) 36.58% compared to head (3cda9ca) 35.46%.
Report is 4 commits behind head on main.

❗ Current head 3cda9ca differs from pull request most recent head 7ec6662. Consider uploading reports for the commit 7ec6662 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #711      +/-   ##
==========================================
- Coverage   36.58%   35.46%   -1.12%     
==========================================
  Files         310      301       -9     
  Lines       34639    34254     -385     
  Branches     5965     5934      -31     
==========================================
- Hits        12671    12149     -522     
- Misses      21399    21557     +158     
+ Partials      569      548      -21     
Flag Coverage Δ
provider-base 5.99% <100.00%> (+0.49%) ⬆️
release-tools ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

bladernr
bladernr previously approved these changes Sep 12, 2023
Copy link
Copy Markdown
Collaborator

@bladernr bladernr left a comment

Choose a reason for hiding this comment

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

Looks good to me... thanks

Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

I have to ask a few changes here:

  • codecov is complaining because we need a new test here, sumarize_cpu is untested
  • it is kind of weird to return -1 instead to throwing an exception. Would you consider changing this to raise an exception both if the file is not found or if it is found and contains a -1? That way anyone calling the function will not have to check if -1 is a valid numa number or what is going on, if something is returned, it is valid, else an exception is thrown
  • Minor: Change the title of the PR after rebasing on main, this is a bugfix so add a (bugfix) postfix to the title!

Ty

@kissiel kissiel changed the title Fix: In network.py, don't pass -A option to iperf3 if NUMA is unsuppo… Don't use '-A' in network.py on non-numa systems (BugFix) Jan 6, 2024
@kissiel
Copy link
Copy Markdown
Contributor

kissiel commented Jan 7, 2024

I added tests and fixed the PR title.
The -1 as the node index is in line with what sysfs would report on a non-numa systems, so I left it in.

@hook please take another look

Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

+1, if this causes a problem we can change in the future I guess

@Hook25 Hook25 enabled auto-merge (squash) January 7, 2024 22:50
@kissiel kissiel force-pushed the fix-cpu-affinity-network branch from 3cda9ca to 7ec6662 Compare January 7, 2024 23:10
@Hook25 Hook25 merged commit 61dfbe3 into main Jan 7, 2024
@Hook25 Hook25 deleted the fix-cpu-affinity-network branch January 7, 2024 23:10
LiaoU3 pushed a commit to LiaoU3/checkbox that referenced this pull request Jan 9, 2024
)

* Fix: In network.py, don't pass -A option to iperf3 if NUMA is unsupported

* add first tests for the network.py

---------

Co-authored-by: Maciej Kisielewski <maciej.kisielewski@canonical.com>
LiaoU3 pushed a commit to LiaoU3/checkbox that referenced this pull request Mar 20, 2024
)

* Fix: In network.py, don't pass -A option to iperf3 if NUMA is unsupported

* add first tests for the network.py

---------

Co-authored-by: Maciej Kisielewski <maciej.kisielewski@canonical.com>
binli pushed a commit to binli/checkbox that referenced this pull request Mar 22, 2024
)

* Fix: In network.py, don't pass -A option to iperf3 if NUMA is unsupported

* add first tests for the network.py

---------

Co-authored-by: Maciej Kisielewski <maciej.kisielewski@canonical.com>
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.

4 participants